Skip to content

GATE CS Linked Lists questions

Practise Linked Lists questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

17 on this page
Official PYQ2026Programming and Data StructuresLinked ListsMCQ · 2 marks
Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head. struct node{ int elt; struct node *next; }; int getListSize (struct node *head) { if( E1 ) return 1; return E2; } Which one of the following options gives the correct replacements for the expressions …
Official PYQ2025Programming and Data StructuresLinked ListsNAT · 2 marks
Let LIST\mathrm{LIST} be a datatype for an implementation of linked list defined as follows: typedef struct list { int data; struct list *next; } LIST; Suppose a program has created two linked lists, L1L1 and L2L2, whose contents are given in the figure below (code for creating L1L1 and L2L2 is not provided here). L1L1 contains 99 nodes, and …
Official PYQ2023Programming and Data StructuresLinked ListsMCQ · 1 mark
Let SLLdel\textsf{SLLdel} be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let DLLdel\textsf{DLLdel} be another function that deletes a node in a doubly-linked list given a pointer to the node and a pointer to the head of the list. Let nn denote the number of nodes in each …
Official PYQ2022Programming and Data StructuresLinked ListsMCQ · 1 mark
Consider the problem of reversing a singly linked list. To take an example, given the linked list below, the reversed linked list should look like Which one of the following statements is TRUE\text{TRUE} about the time complexity of algorithms that solve the above problem in O(1)O(1) space?
Official PYQ2020Programming and Data StructuresLinked ListsMCQ · 1 mark
What is the worst case time complexity of inserting nn elements into an empty linked list, if the linked list needs to be maintained in sorted order?
Official PYQ2017Programming and Data StructuresLinked ListsMCQ · 1 mark
Consider the C code fragment given below. typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->next; } p->next = m; } Assuming that m and n point to valid NULL-terminated linked lists, invocation of join will
Official PYQ2016Programming and Data StructuresLinked ListsMCQ · 1 mark
NN items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this order: Θ(N)\Theta \left(N\right) delete, …
Official PYQ2010Programming and Data StructuresLinked ListsMCQ · 1 mark
The following C function takes a singly-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next; } Node; Node *move_to-front(Node *head) { Node *p, *q; if ((head == NULL) || (head -> next == …
Official PYQ2008Programming and Data StructuresLinked ListsMCQ · 1 mark
The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7 in the given order. What will be the contents of the list after function completes execution? struct node { int value; struct node *next; }; void …
Official PYQ2004Programming and Data StructuresLinked ListsMCQ · 1 mark
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality\text{union, intersection, membership, cardinality} will be the slowest?
Official PYQ2004Programming and Data StructuresLinked ListsMCQ · 1 mark
A circularly linked list is used to represent a Queue. A single variable pp is used to access the Queue. To which node should pp point such that both the operations enQueue\text{enQueue} and deQueue\text{deQueue} can be performed in constant time?
Official PYQ2003Programming and Data StructuresLinked ListsMCQ · 1 mark
Consider the function ff 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 pp, the function ff returns 11 if and only if
Official PYQ2002Programming and Data StructuresLinked ListsMCQ · 1 mark
In the worst case, the number of comparisons needed to search a single linked list of length nn for a given element is
Official PYQ1997Programming and Data StructuresLinked ListsMCQ · 1 mark
The concatenation of two lists is to be performed on O(1)O(1) time. Which of the following implementations of a list should be used?
Official PYQ1995Programming and Data StructuresLinked ListsMCQ · 1 mark
Which of the following statements is true? As the number of entries in a hash table increases, the number of collisions increases. Recursive programs are efficient The worst case complexity for Quicksort is O(n2)O(n^2) Binary search using a linear linked list is efficient
Official PYQ1994Programming and Data StructuresLinked ListsMCQ · 1 mark
Linked lists are not suitable data structures for which one of the following problems?
Official PYQ1987Programming and Data StructuresLinked ListsMCQ · 1 mark
In a circular linked list organization, insertion of a record involves modification of