Data Structures · Previous year questions
Arrays and Linked Lists
11 questions from GATE CS 2015 to 2026, newest first.
Questions
GATE CS 2026 Set 1, Q.39
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...Arrays and Linked Lists
GATE CS 2025 Set 1, Q.62
Let
LISTbe 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 li...Arrays and Linked Lists
GATE CS 2025 Set 2, Q.38
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures: P: Unsorted doub...
Arrays and Linked Lists · Binary Heaps and Priority Queues · Binary Trees, Binary Search Trees and Balanced Trees
GATE CS 2023, Q.13
Let 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 be a function that...
Arrays and Linked Lists
GATE CS 2022, Q.15
Consider the problem of reversing a singly linked list. To take an example, given the linked list below, Singly linked list starting at head with nodes a, b, c, d, e followed by...
Arrays and Linked Lists
GATE CS 2020, Q.26 (CS Q.16)
What is the worst case time complexity of inserting elements into an empty linked list, if the linked list needs to be maintained in sorted order?
Arrays and Linked Lists · Asymptotic Analysis and Time/Space Complexity
GATE CS 2017 Set 1, Q.8 (CS Q.8)
Consider the C code fragment given below. typedef struct node { int data; struct node* next; } node; void join(node* m, node* n) { node* p = n; while (p->next != NULL) { p = p->...
Pointers, Arrays and Strings · Arrays and Linked Lists
GATE CS 2017 Set 2, Q.13 (CS Q.13)
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two exte...
Stacks and Queues · Arrays and Linked Lists
GATE CS 2016 Set 2, Q.25 (CS Q.15)
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 provid...
Arrays and Linked Lists
GATE CS 2015 Set 1, Q.50 (CS Q.40)
An algorithm performs find operations, insert operations, delete operations, and decrease-key operations on a set of data...
Arrays and Linked Lists
GATE CS 2015 Set 2, Q.41 (CS Q.31)
A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with , and hence there cannot be any entr...
Arrays and Linked Lists