All mock tests are FREE till 31 December — register to save your progress
UGC NET · PAPER 2

UGC NET Paper 2 Computer Science – Unit 7: Data Structures and Algorithms PYQ (22 June 2026)

12 questions · answer key at the end · updated 1 Oct 2026
Q51. Match List - I with List - II.
List - IList - II
A. Merge sortI. n²
B. Binary searchII. nlogn
C. Quick sortIII. n
D. Search in an unsorted arrayIV. logn
Choose the correct answer from the options given below:
  1. A-I, B-IV, C-II, D-III
  2. A-I, B-II, C-III, D-IV
  3. A-II, B-I, C-III, D-IV
  4. A-II, B-IV, C-I, D-III
Answer & explanation →
Q52. Consider the following AVL tree: root = 60; left child of 60 = 50; right child of 60 = 70; right child of 70 = 80 (a balanced AVL tree of height 2).
What is the maximum number of nodes that can be inserted in the following AVL tree without changing its height?
  1. 2
  2. 4
  3. 3
  4. 5
Answer & explanation →
Q65. In the worst case, the smallest number of comparisons required by any sorting algorithm, which does only binary comparisons, is
  1. ⌈log n⌉
  2. ⌈log n!⌉
  3. ⌈log n(n−1)⌉
  4. 2ⁿ
Answer & explanation →
Q70. A problem of size n requires n² bit operations. What is the largest size instance that can be solved in 1 second, if each bit operation is carried out in 10⁻⁹ second?
  1. 10⁹
  2. 3.16×10⁴
  3. 3.96×10⁷
  4. 2^(10⁹)
Answer & explanation →
Q73. If f(n) = θ(g(n)) and g(n) = O(h(n)), then which of the following is true?
  1. f(n) = O(h(n))
  2. f(n) = θ(h(n))
  3. h(n) = O(f(n))
  4. h(n) = θ(f(n))
Answer & explanation →
Q81. The number of leaf nodes in a full 4-ary rooted tree of n nodes is
  1. n/2
  2. (2n − 1) / 4
  3. (n + 1) / 4
  4. (3n + 1) / 4
Answer & explanation →
Q82. Which of the following statements maybe false for a decision problem X ∈ NP?
  1. X can be solved in nondeterministic polynomial time
  2. X can be solved in exponential time
  3. X can be solved in polynomial space
  4. X can be solved in deterministic polynomial time
Answer & explanation →
Q97. A binary search tree is obtained by inserting the words "Mathematics", "Physics", "Geography", "Zoology", "Metrology", "Geology", "Psychology" and "Chemistry" in order. Words are compared by dictionary order. Arrange the following words in increasing order of their level in the tree.
A. Mathematics
B. Zoology
C. Psychology
D. Physics
Choose the correct answer from the options given below:
  1. A, D, C, B
  2. A, C, D, B
  3. A, D, B, C
  4. C, B, D, A
Answer & explanation →
Q101. In open addressing, how are collisions typically resolved?
  1. By probing and finding the next available slot in the table
  2. By creating a linked list at the point of collision
  3. By rehashing the entire table
  4. By storing the colliding elements in a separate array
Answer & explanation →
Q114. What is the height of the binary search tree obtained by inserting the numbers 40, 60, 50, 37, 52, 15, 8, 22 in the given order
  1. 4
  2. 3
  3. 2
  4. 1
Answer & explanation →
Q126. Match the LIST-I with LIST-II.
LIST-I (Data structure)LIST-II (Characteristics)
A. StackI. First-In-First-Out (FIFO) order
B. QueueII. Last-In-First-Out (LIFO) order
C. Linked listIII. Nodes with two children ordered
D. Binary search treeIV. Dynamic size, nodes linked sequentially
Choose the correct answer from the options given below:
  1. A-IV, B-I, C-II, D-III
  2. A-II, B-I, C-IV, D-III
  3. A-III, B-IV, C-I, D-II
  4. A-II, B-I, C-III, D-IV
Answer & explanation →
Q130. How will the following min-heap appear on inserting the key 32?
Original min-heap (level order): 5, 10, 25, 30, 40, 50, 60, 70, 80, 90 (root 5; children of 5 are 10 and 25; children of 10 are 30 and 40; children of 25 are 50 and 60; children of 30 are 70 and 80; the only child of 40 is 90).
  1. New node 32 inserted as the right child of 40 (sibling of 90), with no further rearrangement – heap order left unfixed
  2. After insertion the heap is re-arranged so that 10's children become 32 and 30, and 32's children become 90 and 40 (25's children remain 50 and 60)
  3. New node 32 inserted as a second child of 50, leaving the rest of the tree unchanged
  4. New node 32 inserted deep under 30's subtree below the existing leaves, breaking the complete-tree shape
Answer & explanation →

Answer key

  1. 51 – D
  2. 52 – C
  3. 65 – B
  4. 70 – B
  5. 73 – A
  6. 81 – D
  7. 82 – D
  8. 97 – C
  9. 101 – A
  10. 114 – B
  11. 126 – B
  12. 130 – B