|Data Structures and Algorithms Practice

UGC NET Computer Science & Applications Topic-wise Practice

📊

Data Structures and Algorithms

Data Structures and Algorithms is Unit 7 of the UGC NET Computer Science and Applications syllabus, and it is one of the units where questions are worked out rather than recalled. Expect to unwind recurrence relations, trace traversals by hand, and compare complexity classes — and expect the paper to ask it through matching, sequencing, and multi-statement formats far more often than through plain definitions.

3 sets34 questions10 Q per set
Recommended next
View all setsPYQs & full tests

Available Practice Sets

Choose any set, or follow the recommended next set above.

Recommended

Every Data Structures and Algorithms question ever asked

34 previous year questions from 2020–2025, each with its options and the correct answer — free to read.

View 34 PYQs

What this topic covers

1Linear structures — arrays, linked lists, stacks and queues — and which operations each one makes cheap or expensive
2Trees: binary search trees, AVL and red-black balancing, heaps, and B-trees of a stated order
3Graphs: adjacency representations, BFS and DFS, minimum spanning trees, and shortest-path algorithms
4Hashing: designing a hash function, and resolving collisions by chaining or open addressing
5Sorting and searching, including which algorithms are stable and which work in place
6Asymptotic notation, and solving recurrence relations by substitution or the Master theorem
7Algorithm design paradigms: divide and conquer, greedy, and dynamic programming
8Backtracking and branch and bound
9Complexity classes P, NP, NP-complete and NP-hard, and what a reduction actually proves

Key concepts to revise

1The Master theorem and its limits — recurrences such as T(n) = T(2n/3) + 1 are asked directly, so practise unwinding them rather than pattern-matching
2Stability: Bubble, Insertion and Merge Sort preserve the order of equal keys; Quick Sort and Shell Sort do not, and this exact contrast is a recurring question
3Worst case versus average case — a red-black tree guarantees O(log n) search, insertion and deletion in the worst case, while an unbalanced BST degrades to O(n)
4Inorder, preorder and postorder traversal, and rebuilding a binary tree when two of the three orders are given
5Prim's and Dijkstra's grow a frontier from a source using a priority queue, which is why both are described as BFS-based; Kruskal's sorts edges globally with union-find and is not
6A 2-3-4 tree is a B-tree of order 4, and a red-black tree is its binary encoding — the equivalence is asked as a true-or-false statement
7Evaluating a postfix expression with a stack, and converting between infix, prefix and postfix notation

How to prepare this topic

1Work the recurrence and asymptotic-ordering questions on paper. These are the ones where reasoning backwards from the options fails, because the distractors are all plausible growth rates
2For every algorithm, learn one line on why it works and which paradigm it belongs to — the paper asks you to classify a method at least as often as it asks for its complexity
3Drill the multi-statement format, where statements A to E are followed by 'choose the correct answer'. Partial knowledge scores nothing, so decide on every statement before looking at the combinations
4Trace one full example of each traversal and of one AVL rotation until the steps are recall, not derivation. Under time pressure a half-remembered rotation costs more than it saves
5Come back to the 2024 Computer Science papers once the unit feels solid — the matching questions reuse the same pairings, so they are quick marks on a second pass

Common mistakes to avoid

1Reading O(n log n) as Quick Sort's answer when the question asks for the worst case, which is O(n²)
2Treating stability and in-place as the same property — a sort can have either without the other
3Assuming Prim's and Kruskal's are interchangeable because both produce a minimum spanning tree; only one of them is BFS-based
4Expecting every self-balancing tree to give the same guarantee, when AVL is more strictly height-balanced than red-black and pays for it with extra rotations
5Answering a match-the-list question after checking two pairs, when the distractor options differ only in the third or fourth
6Dropping the base case while unwinding a recurrence, which shifts the final count by one and lands you on a distractor

Related Topics

Frequently Asked Questions

How many marks is Data Structures and Algorithms worth in UGC NET Computer Science?

There is no fixed quota per unit. Paper 2 carries 100 questions worth 2 marks each with no negative marking, and this is one of ten units, so a typical paper draws several questions from it — enough that the unit rewards solving rather than skipping.

Do I need to write code for this unit?

No. Every question is multiple choice. You do need to read short C and C++ fragments and predict their output, and to trace an algorithm by hand, but nothing has to be written from scratch.

Which parts of this unit repeat most often in the paper?

Recurrence relations and asymptotic ordering, tree traversals, sorting properties such as stability, and identifying which paradigm an algorithm belongs to. All four are asked heavily through matching and sequencing questions.

Are these practice sets free?

Yes. Every Data Structures and Algorithms set on this page is free to attempt, and the answer key with a worked explanation is shown as soon as you submit.