Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?
GATE CSE · Programming In C
Practice problems for Linked List in Programming in C.
34 questions · 14 PYQs · 0 AI practice · GATE CSE 2027
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?
The minimum number of fields with each node of doubly linked list is
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure. The function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order. What will be the contents of the list after the function completes execution? struct node {int value; struct node *next;);
void rearrange (struct node *list) {
struct node *p, *q;
int temp;
if (!list || !list -> next) return;
p = list;
q = list -> next;
while (q) {
temp = p -> value;
p -> value = q -> value;
q -> value = temp;
p = q -> next;
q = p ? p -> next : 0;
}
}
Suppose there are sorted lists of elements each. The time complexity of producing a sorted list of all these elements is: (Hint: Use a heap data structure)
A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time?

Suppose each set is represented as a linked list with elements in arbitray order. Which of the operations among union, intersection, membership, cardinality will be the slowest?
Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity of the best-known algorithm to delete the node x from the list ?
Consider the function f defined below. struct item { int data; struct item * next; };
int f(struct item *p) {
return ((p == NULL) || (p->next == NULL) || ((P->data <= p->next->data) && f(p->next)));
}
For a given linked list p, the function f returns 1 if and only if
In the worst case, the number of comparisons needed to search a single linked list of length n for a given element is
The concatenation of two lists is to be performed on O(1) time. Which of the following implementations of a list should be used?
Which of the following statements is true? I. As the number of entries in a hash table increases, the number of collisions increases. II. Recursive programs are efficient III. The worst case complexity for Quicksort is IV. Binary search using a linear linked list is efficient
For merging two sorted lists of sizes and into a sorted list of size , we require comparisons of
Linked lists are not suitable data structures for which one of the following problems?
In a circular linked list oraganisation, insertion of a record involves modification of
Want unlimited AI-generated Linked List questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →