Counted from the questions in the past papers listed on this site. Repeated = how many times the topic came in those papers.
Data Structures important questions with answers
Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The questions under each topic are copied from the RGPV papers.
Q1. Infix to postfix conversion and postfix evaluation
Asked 11 times in 2020, 2022, 2023, 2024, 2025 · Unit 2
From the papers
“Write a 'C' program to convert the infix expression to postfix expression.” (2020, 2023, 2024)
“How can you convert an infix expression to postfix expression using stack? Give one example.” (2020, 2024)
“Post fix expression evaluation” (2022, 2024)
The short answer
In infix form the operator sits between its operands (A + B), while in postfix form it comes after them (A B +). Postfix needs no brackets, so one stack can evaluate it.
Write these points
Precedence from high to low: ^ (right to left), then * and /, then + and -. Equal operators go left to right.
Conversion uses an operator stack. Operands go straight to the output.
For an operator, pop every stack operator of equal or higher precedence to the output, then push the new one.
A left bracket is pushed. A right bracket pops to the output until the left bracket. At the end pop the whole stack.
Evaluation uses an operand stack. Push operands. For an operator pop b, pop a, then push a op b.
A shop calculator that shows 2 + 3 × 4 = 14 does not work left to right. Inside, it turns your input into postfix (2 3 4 × +) with a stack and then works it out with another stack. That is why it follows precedence.
Figure: Infix to postfix conversion and postfix evaluation
Same or opposite: infix and postfix notation
Point
Infix
Postfix
Same or opposite
Operator position
Between operands
After operands
Opposite
Brackets needed
Yes
No
Opposite
Evaluated with
Precedence rules
One operand stack
Opposite
Same value
Yes
Yes
Same
Exam tip. Draw the stack and output after every symbol. The first value popped is the right operand b. Check by writing the postfix back as infix.
Q2. Singly and circular linked list: representation and operations
Asked 11 times in 2020, 2022, 2023, 2024, 2025 · Unit 1
From the papers
“Write an algorithm for traversing nodes in a single linked list? Explain with an example.” (2020, 2024)
“Write an algorithm for insert and delete operations in circular linked list.” (2023, 2024)
“Describe the memory representation of a Singly Linked List. Write an algorithm to insert a node at a specific position in a linked list.” (2025)
The short answer
A linked list is a chain of nodes where each node holds data with a pointer to the next node. Nodes can sit anywhere in memory, so the list grows at run time.
Write these points
Node in C: struct node { int data; struct node *next; }. The pointer head holds the first node and the last node points to NULL.
In a circular list the last node points back to the first, so no node holds NULL. A doubly list has prev and next pointers.
Insert and delete need no shifting, unlike an array. The cost is extra memory for pointers and no access by index.
Circular insert at end: new->next = head, last->next = new. Traversal stops when ptr->next == head.
Insert, delete and walk a circular list.
List 10 → 20 → 30. Insert 25 after node p = 20: new.next = p.next (30), then p.next = new.
The list is now 10 → 20 → 25 → 30. The order of the two steps matters, or 30 is lost.
Delete the first node: head = head.next. The list is 20 → 25 → 30.
Make it circular: last.next = head. Counting nodes stops when the pointer comes back to head, giving 3.
Real-life example
A music app playlist is a linked list. Each song knows the next one. Turn on 'repeat all' and the last song points back to the first, which makes it a circular list.
Figure: Singly and circular linked list: representation and operations
Same or opposite: singly and circular linked list
Point
Singly
Circular
Same or opposite
Last node points to
NULL
The first node
Opposite
End of traversal test
ptr == NULL
ptr->next == head
Opposite
Insert needs no shifting
Yes
Yes
Same
Good for
Simple lists
Round robin turns
Opposite
Exam tip. Draw the list before and after each change. Set the new pointer before you break the old link. Circular end test is ptr->next == head.
Full test: (rear + 1) mod 5 = 2 = front, so it is full again with 30, 40, 50, 60, 70.
A simple linear queue would report full at rear = 4 although slots 0 and 1 were empty.
Real-life example
A ticket counter line is a queue: first come, first served. A hospital emergency room is a priority queue: the most serious patient goes first, whoever came earlier.
Figure: Queue: simple, circular, priority and double ended queue
Same or opposite: simple queue and circular queue
Point
Simple queue
Circular queue
Same or opposite
Space after deletions
Wasted at the front
Reused by wrapping round
Opposite
Rear moves as
rear + 1
(rear + 1) mod n
Opposite
Full test
rear == n − 1
(rear + 1) mod n == front
Opposite
FIFO order
Yes
Yes
Same
Exam tip. Show front and rear for every step. Write the full test (rear+1) % n == front.
Q4. Data structures: classification, ADT, operations and cost
Asked 8 times in 2020, 2022, 2023, 2024, 2025 · Unit 1
From the papers
“Explain the classification of data structures in detail.” (2025)
“Define Abstract Data Types (ADT). Explain the different operations performed on data structures and describe the criteria for cost estimation.” (2025)
“Define data structures. Classify different types of data structures.” (2024)
The short answer
A data structure is a way of storing data so that search, insert and delete are done efficiently. An abstract data type (ADT) lists the values and operations without saying how they are coded.
Write these points
Primitive: int, float, char, pointer. Non-primitive: linear (array, list, stack, queue) and non-linear (tree, graph).
Static structures have fixed size (array). Dynamic structures grow at run time (linked list, dynamic array that doubles when full).
ADT example: stack has push, pop, peek and isEmpty. The user does not see the array or list inside.
Operations: traversal, insertion, deletion, searching, sorting and merging.
Cost is time and space in Big O, for best, average and worst case.
Structure
Search
Insert
Delete
Array
O(n)
O(1) at end
O(n)
Linked list
O(n)
O(1) at head
O(n)
Stack or queue
O(n)
O(1)
O(1)
Balanced BST
O(log n)
O(log n)
O(log n)
Why the choice of structure matters.
Search for a roll number among 1,000,000 records.
Unsorted array, linear search: up to 1,000,000 comparisons, O(n).
Sorted array, binary search: at most ⌈log₂ 1,000,000⌉ = 20 comparisons, O(log n).
The Stack ADT (push, pop, peek, isEmpty) is the same whether it is coded with an array or a linked list.
Real-life example
A library keeps books on shelves by number (array), a waiting list for new books (queue) and a catalogue tree by subject. Each one is a different data structure picked for the job it must do fast.
Figure: Data structures: classification, ADT, operations and cost
Same or opposite: linear and non-linear data structure
Point
Linear
Non-linear
Same or opposite
Arrangement
One after another
Levels or a network
Opposite
Examples
Array, stack, queue, list
Tree, graph
Opposite
Traversal
One pass
Many paths
Opposite
Stores data with operations
Yes
Yes
Same
Exam tip. Draw the classification chart first. Define ADT in one line with an example.
Q5. Minimum spanning tree: Kruskal and Prim algorithms
Asked 8 times in 2020, 2022, 2023, 2024, 2025 · Unit 4
From the papers
“Discuss Kruskal's algorithm with an following graph.” (2022, 2023, 2024)
“What is a Minimum Spanning Tree (MST)? Explain Kruskal's or Prim's algorithm to find the MST of a weighted graph.” (2025)
“Define minimum spanning tree. Write down Prim's algorithm to find minimum spanning tree.” (2024)
The short answer
A spanning tree of a connected graph with n vertices has all n vertices and n-1 edges with no cycle. The minimum spanning tree (MST) has the smallest total weight.
Write these points
Kruskal is edge based. Sort the edges. Add an edge if it makes no cycle. Stop at n-1 edges. Time O(E log E).
Prim is vertex based. Grow one tree from any vertex. Each time add the cheapest edge to a new vertex. Time O(V^2), or O(E log V) with a heap.
Kruskal
Prim
Works on
Edges
Vertices
Cycle check
Needed
Not needed
Best for
Sparse graph
Dense graph
Steps
Kruskal on the picture: sorted edges 3, 4, 5, 6, 7, 8, 9. Take 3, 4 and 5. Skip 6 (cycle 1-2-3). Take 7. Four edges, cost 19.
Prim from 0: pick 0-1 (4), then 1-2 (3), then 2-3 (5), then 3-4 (7). Cost 19. Both methods give the same cost.
In the exam repeat these steps on the given graph and list the chosen edges.
Kruskal and Prim on one graph.
Edges: AB 1, CD 2, BC 3, AC 4, DE 5, BE 6, CE 7 on vertices A to E.
Kruskal takes them in order: AB 1, CD 2, BC 3. AC 4 would make the cycle A, B, C, so skip it. DE 5 completes the tree.
That is 4 edges = n − 1. Total weight = 1 + 2 + 3 + 5 = 11.
Prim from A adds AB 1, then BC 3, then CD 2, then DE 5. The total is again 11.
Real-life example
A cable TV company wants to connect every house in a colony with the least wire, with no loops. The cheapest such layout is a minimum spanning tree of the street map.
Figure: Minimum spanning tree: Kruskal and Prim algorithms
Same or opposite: Kruskal and Prim
Point
Kruskal
Prim
Same or opposite
Grows by
Cheapest edge anywhere
Cheapest edge from the tree
Opposite
Cycle check
Needed (union-find)
Not needed
Opposite
Best for
Sparse graphs
Dense graphs
Opposite
Gives the same total cost
Yes
Yes
Same
Exam tip. An MST of n vertices has n-1 edges. Write the total cost at the end.
Q6. Binary tree traversals: inorder, preorder and postorder
Asked 8 times in 2020, 2023, 2024, 2025 · Unit 3
From the papers
“How a binary search tree is traversed? Explain with a suitable example.” (2023, 2024)
“Write functions to implement recursive versions of preorder, inorder and postorder traversals of a binary tree.” (2020, 2024)
“Define a Binary Search Tree (BST). Explain the algorithms for In-order, Pre-order, and Post-order traversal with an example.” (2025)
The short answer
A traversal visits every node of a binary tree once. The three depth first orders differ in when the node is visited.
Write these points
Inorder: left, node, right. For a BST it gives sorted keys.
Preorder: node, left, right. It gives the prefix form of an expression tree.
Postorder: left, right, node. It gives the postfix form. Every traversal takes O(n) time.
Pseudocode inorder(t): if t != NULL then inorder(t->left), visit t, inorder(t->right). The other two only move the visit line.
Example.
Tree from inorder D B E A C and postorder D E B C A: the last item of postorder, A, is the root. D B E is left of A and C is right. The postorder of the left part is D E B, so B is its root with children D and E. Tree: A(B(D, E), C).
Real-life example
When a compiler reads a + b × c, it builds an expression tree. Postorder traversal of that tree gives a b c × +, which a stack can evaluate. Inorder gives back the normal expression.
Figure: Binary tree traversals: inorder, preorder and postorder
Same or opposite: preorder and postorder
Point
Preorder
Postorder
Same or opposite
Root visited
First
Last
Opposite
Order
Root, left, right
Left, right, root
Opposite
Expression tree gives
Prefix form
Postfix form
Opposite
Visits every node once
Yes
Yes
Same
Exam tip. Draw the tree before writing any order. The last item of postorder (first of preorder) is the root.
Q7. Stack: operations and implementation using array and linked list
Asked 7 times in 2020, 2022, 2023, 2024, 2025 · Unit 2
From the papers
“Write an algorithm which reverses the order of elements on stack using one additional stack and some additional variables.” (2020, 2024)
“Define Stack as an ADT. Explain the array and linked list implementation of stacks.” (2025)
“Write an algorithm for Push and Pop operations on Stack using linked list.” (2024)
The short answer
A stack is a linear structure where insert and delete happen only at the top. The last item pushed is the first popped, so it is LIFO.
Write these points
Operations: push, pop, peek, isEmpty and isFull.
Array: top starts at -1. Push on a full stack is overflow. Pop on an empty stack is underflow.
Linked list: top is a head pointer. Push inserts at the beginning and pop deletes the first node.
Uses: expression conversion, recursion, bracket matching, undo and DFS.
Steps
push(x): if top == MAX-1 print overflow. Else top = top + 1, S[top] = x.
pop(): if top == -1 print underflow. Else x = S[top], top = top - 1, return x.
List push: new->next = top, top = new. List pop: temp = top, top = top->next, free(temp).
Array stack of size 4.
Push 5, 8, 3: top = 2.
Pop returns 3 and top = 1.
Push 9, then 7: top = 3 and the stack holds 5, 8, 9, 7.
Push 1: top + 1 = 4 = size, so the push fails with overflow.
Real-life example
The undo button in a text editor is a stack. Every change is pushed. Pressing undo pops the last change first. A pile of plates in a canteen works the same way.
Figure: Stack: operations and implementation using array and linked list
Same or opposite: array and linked list stack
Point
Array stack
Linked list stack
Same or opposite
Size
Fixed
Grows at run time
Opposite
Overflow
When the array is full
Only when memory runs out
Opposite
Push and pop time
O(1)
O(1)
Same
Extra memory
None
One pointer per node
Opposite
Exam tip. Write the overflow and underflow checks. Say LIFO and give one application.
Asked 7 times in 2020, 2022, 2023, 2024, 2025 · Unit 4
From the papers
“Differentiate between Depth first search and Breadth First search algorithm.” (2020, 2024)
“Describe the Depth First Search (DFS) and Breadth First Search (BFS) algorithms for graph traversal with examples.” (2025)
“Write algorithms for DFS and BFS traversal on a graph.” (2023)
The short answer
Graph traversal visits every reachable vertex once. BFS goes level by level with a queue, while DFS goes deep first with a stack or recursion and then backtracks.
Write these points
Both need a visited mark per vertex. Time is O(V + E) with an adjacency list.
BFS finds the fewest-edge path in an unweighted graph. DFS finds cycles and connected components.
In the picture neighbours are taken in increasing order. BFS gives 1 2 3 4 5 6. DFS gives 1 2 4 5 6 3.
BFS
DFS
Uses
Queue
Stack or recursion
Order
Level by level
Deep, then back
Shortest path
Yes (unweighted)
No
Steps
BFS: mark s and enqueue it. While the queue is not empty: u = dequeue, visit u, mark and enqueue each unvisited neighbour.
DFS(u): mark u, visit u, call DFS(v) for each unvisited neighbour v.
BFS and DFS from A.
Edges: A to B and C, B to D and E, C to F, E to F.
BFS with a queue: visit A, then B and C, then D, E and F. Order A B C D E F.
DFS going deep first: A, B, D, back to B, then E, F, back up, then C. Order A B D E F C.
F is visited once in both, because it is marked when first reached.
Real-life example
LinkedIn shows 1st, 2nd and 3rd degree connections. Finding them is BFS: first your friends, then their friends. Solving a maze by following one path to its end and then backtracking is DFS.
Figure: Graph traversal: BFS and DFS
Same or opposite: BFS and DFS
Point
BFS
DFS
Same or opposite
Uses
Queue
Stack or recursion
Opposite
Order
Level by level
Deep first, then back
Opposite
Time with adjacency list
O(V + E)
O(V + E)
Same
Shortest path (unweighted)
Yes
No
Opposite
Exam tip. Show the queue or stack at each step. State the start vertex and neighbour order.
Asked 7 times in 2020, 2022, 2023, 2024, 2025 · Unit 5
From the papers
“Explain sequential search and simulate it for the following data 4, 21, 36, 14, 62, 91, 8, 22, 81, 77, 10.” (2022, 2023, 2024)
“Apply Binary search to search 36 in following list :” (2023, 2024)
“Explain Binary Search with an example.” (2025)
The short answer
Searching finds the position of a key in a list, or reports that it is absent.
Write these points
Sequential search checks each item from the first. It works on any list. Worst case O(n).
Binary search needs a sorted array. It compares the key with the middle item and drops half the list each time. Time O(log n).
Sequential
Binary
Sorted list needed
No
Yes
Worst case
O(n)
O(log n)
Steps
Binary search: low = 0, high = n-1. While low <= high: mid = (low + high) / 2.
If A[mid] == key return mid. If key < A[mid] then high = mid-1. Else low = mid+1.
Example.
Binary search in 4 8 10 14 21 22 36 62 77 81 91 for key 36. Mid 5 gives 22, so go right.
Mid 8 gives 77, so go left. Mid 6 gives 36: found at index 6 in 3 steps.
Sequential search in 4 21 36 14 62 91 8 22 81 77 10 finds 36 at the 3rd place.
Real-life example
To find a word in a dictionary you open the middle and check whether the word comes before or after. Then you drop half the book. That is binary search. Looking for a name in an unsorted attendance sheet is sequential search.
Figure: Searching: sequential and binary search
Same or opposite: sequential and binary search
Point
Sequential
Binary
Same or opposite
Sorted data needed
No
Yes
Opposite
Worst case
O(n)
O(log n)
Opposite
Works on a linked list
Yes
Not efficiently
Opposite
Returns the position of the key
Yes
Yes
Same
Exam tip. Show low, high and mid at each step. Binary search works only on sorted data.
Merge sort 38 27 43 3: split into 38 27 and 43 3, then sort each half to 27 38 and 3 43.
Merge the halves: 3, 27, 38, 43.
Real-life example
A teacher arranging answer sheets by roll number may split the pile in two, sort each half, then merge them. That is merge sort. Swapping neighbouring sheets again and again is bubble sort.
Figure: Sorting: bubble sort, shell sort and merge sort
Same or opposite: bubble sort and merge sort
Point
Bubble sort
Merge sort
Same or opposite
Worst time
O(n²)
O(n log n)
Opposite
Extra space
O(1)
O(n)
Opposite
Stable
Yes
Yes
Same
Method
Swap neighbours
Divide and merge
Opposite
Exam tip. Show the list after every pass or gap. State best and worst time.
Q11. Hashing: hash functions and collision handling
Asked 6 times in 2020, 2022, 2023, 2024, 2025 · Unit 5
From the papers
“Hashing” (2022, 2024)
“Linear Probing and Chaining” (2025)
“Hashing and Indexing” (2024)
The short answer
Hashing stores a key at the index h(key), so search, insert and delete take about O(1) time. A collision is two keys with the same index.
Write these points
Division method: h(k) = k mod m, with m a prime. Others: mid square, folding and digit extraction.
Chaining keeps a linked list in each slot. Open addressing keeps keys in the table: linear probing tries h+1, h+2, quadratic probing tries h+i^2, double hashing uses a second function.
Indexing maps a key to the place of its record, so the whole file need not be scanned.
Key
h = k mod 7
Slot after linear probing
50
1
1
700
0
0
76
6
6
85
1
2 (1 taken)
92
1
3 (1, 2 taken)
73
3
4 (3 taken)
101
3
5 (3, 4 taken)
Example.
Size 7, keys 50 700 76 85 92 73 101, h = k mod 7. Chaining is in the picture. Linear probing gives the table below.
Good hash function: quick to compute, spreads keys evenly, uses the whole key.
Load factor α = keys / table size. Keep it below about 0.7 for open addressing.
Real-life example
A school locker room gives each student locker number = roll number mod 100. Two students with roll 105 and 205 get the same locker. That clash is a collision. The school must decide where the second one goes.
Figure: Hashing: hash functions and collision handling
Same or opposite: chaining and linear probing
Point
Chaining
Linear probing
Same or opposite
Where clashing keys go
A list in the same slot
The next free slot
Opposite
Table can hold more keys than slots
Yes
No
Opposite
Clustering
No
Yes
Opposite
Average search near O(1)
Yes
Yes
Same
Exam tip. Show each key with its hash value and final slot. Name the collision method you use.
Q12. Binary search tree: search, insert and delete
Asked 5 times in 2020, 2022, 2024 · Unit 3
From the papers
“Write a 'C' program, how to insert and delete elements in the Binary search tree?” (2022, 2024)
“Create a binary search tree for the following numbers 45, 26, 10, 60, 70, 30, 40.” (2024)
“What is a binary search tree? Write down its properties. Suggest an example.” (2020)
The short answer
A binary search tree (BST) keeps smaller keys in the left subtree and larger keys in the right subtree of every node. Its inorder traversal is sorted.
Write these points
Search and insert go left or right by comparing the key. A new key becomes a leaf.
Delete: a leaf is removed. A node with one child is replaced by it. A node with two children takes its inorder successor value, then the successor is deleted.
Time is O(log n) for a balanced tree and O(n) for a skewed tree.
Deleting 26 in the picture puts 30 in its place and 40 moves up.
Steps
insert(t, key): if t == NULL return a new node. If key < t->data then t->left = insert(t->left, key). Else t->right = insert(t->right, key). Return t.
Search 60: 50 (go right), 70 (go left), 60 found in 3 comparisons.
Delete 30, which has two children. Its inorder successor 40 takes its place.
The tree becomes 50 with left child 40 (child 20) and right child 70 (children 60, 80).
Real-life example
A phone contact list kept as a BST lets the phone find 'Ravi' by going left or right at each name. Each step cuts the remaining contacts, so even a long list is searched quickly.
Figure: Binary search tree: search, insert and delete
Same or opposite: BST and plain binary tree
Point
BST
Binary tree
Same or opposite
Order rule
Left < root < right
None
Opposite
Search time
O(h)
O(n)
Opposite
Inorder traversal gives
Sorted order
Any order
Opposite
At most two children
Yes
Yes
Same
Exam tip. Compare with the root first. Say the three delete cases.
“Is there any difference between threaded and unthreaded binary tree? What is a B-tree? Explain.” (2023)
The short answer
A B tree of order m is a balanced multiway search tree with at most m children per node and all leaves at one level. A B+ tree keeps all data in linked leaves.
Write these points
Big nodes fill one disk block, so the tree is short and a search needs few disk reads. Databases use it.
Insert in a leaf. On overflow split at the median and move it up. A root split adds one level.
Delete a key. If the node has too few keys, borrow from a sibling or merge.
B* tree keeps nodes at least two thirds full.
B tree
B+ tree
Data stored
Every node
Leaves only
Leaf links
No
Yes
Range search
Slow
Fast
Example.
Order 3: insert 10, 20, 30. The node [10 20 30] overflows. Split at 20: root [20] with children [10] and [30].
Real-life example
Database tables in MySQL are indexed with B+ trees. A query reaches a record in three or four disk reads, even among millions of rows, because each node holds many keys.
Figure: B tree and B+ tree
Same or opposite: B tree and B+ tree
Point
B tree
B+ tree
Same or opposite
Data pointers in
All nodes
Leaves only
Opposite
Leaves linked
No
Yes
Opposite
Range queries
Slower
Fast
Opposite
Balanced, all leaves at one level
Yes
Yes
Same
Exam tip. Draw the tree after every split. State the order of the tree.
“What are AVL Trees? Explain the four types of rotations (LL, RR, LR, RL) used to balance an AVL tree.” (2025)
“Describe the algorithms used to perform single and double rotation on AVL tree.” (2024)
“Insert the following data keys in the AVL Tree:” (2023)
The short answer
An AVL tree is a BST in which every node has a balance factor (left height minus right height) of -1, 0 or +1. A rotation restores balance after insert or delete.
Write these points
Height stays O(log n), so search, insert and delete take O(log n).
Rotate at the first unbalanced node on the path back from the new node.
LR case: rotate left at the child, then right at the node. RL is the mirror.
Case
New key goes
Fix
LL
Left of left child
Right rotation
RR
Right of right child
Left rotation
LR
Right of left child
Left, then right
RL
Left of right child
Right, then left
Steps
Right rotation at x: y = x->left, x->left = y->right, y->right = x, return y.
LR example: insert 50, 40, 45. Rotate left at 40, then right at 50. Root is 45 with children 40 and 50.
Two rotations.
Insert 10, 20, 30. Node 10 gets balance factor −2 with a right-right shape.
One left rotation at 10 makes 20 the root with children 10 and 30.
Insert 25, then 28. Node 30 gets balance factor +2 while its child 25 is −1: a left-right case.
Rotate left at 25, then right at 30. Node 28 takes that place with children 25 and 30.
Final tree: 20 with children 10 and 28. Every balance factor is −1, 0 or +1.
Real-life example
If names are added to a BST in alphabetical order, it becomes a long chain and search slows to O(n). An AVL tree rotates after each insert to keep it short, so search stays O(log n).
Figure: AVL tree and its rotations
Same or opposite: AVL tree and BST
Point
AVL tree
BST
Same or opposite
Balance factor
−1, 0 or +1
Any
Opposite
Worst search
O(log n)
O(n)
Opposite
Rotations
After insert and delete
None
Opposite
Order rule left < root < right
Yes
Yes
Same
Exam tip. Write balance factors after each insert. Name the case before you rotate.
List 35 50 15 25 80 20 90 45 with the last item 45 as pivot.
Move each item ≤ 45 to the left part: 35, 15, 25 and 20 in turn.
Put the pivot after them: 35 15 25 20 45 50 90 80. The pivot is now in its final place.
Sort 35 15 25 20 and 50 90 80 the same way. Result: 15 20 25 35 45 50 80 90.
Real-life example
Sorting students by height, you pick one student as the pivot. Shorter ones stand on the left, taller on the right. Then you repeat inside each group. That is quick sort.
Figure: Quick sort with an example
Same or opposite: quick sort and merge sort
Point
Quick sort
Merge sort
Same or opposite
Average time
O(n log n)
O(n log n)
Same
Worst time
O(n²)
O(n log n)
Opposite
Extra space
O(log n) stack
O(n)
Opposite
Stable
No
Yes
Opposite
Divide and conquer
Yes
Yes
Same
Exam tip. Show the list after each partition. Mention the O(n^2) worst case.
RGPV teaches Data Structures to 3 branches under one syllabus. Each branch prints its own code on the paper, but the units are the same. So one page and one PDF serve all of them.
We counted every question in the Data Structures papers on this site by topic, from 2020 to 2025. A topic that keeps coming back is a topic RGPV likes, so it sits higher in the table. One branch alone has only a few papers. Counting them together gives a surer list.
Data Structures important questions by branch
CS-303Data Structures important questions for CSE, Semester 3
CS-303 follows the same RGPV syllabus as the other codes on this page. The 15 topics and answers above are the CS-303 important questions too.
Data Structures (CS-303) teaches how to store data so a program can use it fast. It is a Semester 3 subject of RGPV B.Tech CSE with five units: linear structures, stacks and queues, trees, graphs and sorting with searching. Code every structure at least once in C, because exam questions test whether you can trace the steps.
Data Structures unit-wise brief
Unit 1: Introduction to data structures
This unit reviews C and introduces data, information and abstract data types. You learn how data sits in memory, how to estimate the cost of an operation, and how arrays and linked lists work, including circular and doubly linked lists. Polynomial handling with a linked list is a classic application, so try it yourself.
Unit 2: Stacks and queues
A stack removes the last item added, and a queue removes the first. The unit covers different ways to build each, multiple stacks, circular queues, double-ended and priority queues, and uses such as converting infix to postfix and evaluating a postfix expression. Trace a postfix example on paper until it feels easy.
Unit 3: Trees
Trees store data in levels. You learn the basic terms, binary search trees with insertion, search and traversal, AVL trees and heaps, and then get an introduction to multi-way trees such as B, B+ and B* trees and red-black trees. Draw the tree after every insertion; rotations are easy to get wrong in your head.
Unit 4: Graphs
A graph links items in any pattern. This unit covers directed and undirected graphs, ways to store them, traversal by depth first and breadth first search, and the minimum spanning tree algorithms of Kruskal and Prim. It also covers Dijkstra's shortest path algorithm. Run each algorithm on a small graph by hand.
Unit 5: Sorting and searching
This unit compares sorting methods: bubble, selection, insertion, shell, quick, merge, heap and radix sort. It then covers sequential and binary search, hashing and indexing, with a case study of how operating systems and databases use these structures. Make a small table of each sort's steps and cost to compare them quickly.
Units follow the RGPV scheme and syllabus, B.Tech Computer Science and Engineering, Semester 3 (AICTE flexible curriculum, batches admitted July 2020 (w.e.f. July 2021)). For the full topic list of each unit, open the Data Structures notes.
What are the most important topics in Data Structures?
By how often they were asked in the papers on this site: Infix to postfix conversion and postfix evaluation (11 times); Singly and circular linked list: representation and operations (11 times); Queue: simple, circular, priority and double ended queue (9 times); Data structures: classification, ADT, operations and cost (8 times); Minimum spanning tree: Kruskal and Prim algorithms (8 times).
How were these Data Structures important questions chosen?
Each topic was counted from the questions in the past papers listed on this site (2020-2025). Repeated is the number of times the topic came. The counts come from keyword matching and the answers are not teacher-reviewed, so use them together with your syllabus.
Is there a PDF of Data Structures important questions with answers?
Yes. The Paperwala Imp Question & Answer PDF for Data Structures is free to download from this page.
The 15 most repeated topics of Data Structures (CS-303) for RGPV B.Tech CSE semester 3, counted from the previous year papers on this site. The same syllabus is taught under 3 codes: CS-303, AD-303, IS-303. Data Structures is also searched for as CO-303.