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 (September 2022)

11 questions · answer key at the end · updated 11 Oct 2026
Q52. Assume that f(n), g(n) and h(n) are asymptotically positive. Which of the following is correct?
  1. f(n) = O(g(n)) and g(n) = O(h(n)) ⇒ f(n) = ω(h(n))
  2. f(n) = Ω(g(n)) and g(n) = Ω(h(n)) ⇒ f(n) = O(h(n))
  3. f(n) = o(g(n)) and g(n) = o(h(n)) ⇒ f(n) = o(h(n))
  4. f(n) = ω(g(n)) and g(n) = ω(h(n)) ⇒ f(n) = Ω(h(n))
Answer & explanation →
Q53. The solution of the recurrence relation T(n) = 3T(n/4) + n log n is
  1. Θ(n2 log n)
  2. Θ(n log n)
  3. Θ(n log2 n)
  4. Θ(log log n)
Answer & explanation →
Q54. The number of nodes of height h in any n-element heap is at most
  1. ⌈n / 2h+1⌉
  2. ⌈n / 2h−1⌉
  3. ⌈n / 2h⌉
  4. ⌈(n − 1) / 2h−1⌉
Answer & explanation →
Q55. Consider a B-tree of height h and minimum degree t ≥ 2 that contains n keys, n ≥ 1. Which of the following is correct?
  1. h ≥ logt((n + 1)/2)
  2. h ≤ logt((n + 1)/2)
  3. h ≥ logt((n − 1)/2)
  4. h ≤ logt((n − 1)/2)
Answer & explanation →
Q56. Which algorithm design approach is used in the quick sort algorithm?
  1. Dynamic programming
  2. Backtracking
  3. Divide and conquer
  4. Greedy approach
Answer & explanation →
Q57. Consider a hash table of size 11 that uses open addressing with linear probing, with h(k) = k mod 11. Records with keys 43, 36, 92, 87, 11, 47, 11, 13, 14 are inserted into an initially empty table with bins 0–10. What is the index of the bin into which the last record is inserted?
  1. 8
  2. 7
  3. 10
  4. 4
Answer & explanation →
Q58. Consider the traversals of a tree:
Preorder → ABCEIFJDGHKL
Inorder → EICFJBGDKHLA
Which of the following is the correct postorder traversal?
  1. EIFJCKGLHDBA
  2. FCGKLHDBUAE
  3. FCGKLHDBAEIJ
  4. IEJFCGKLHDBA
Answer & explanation →
Q59. How many rotations are required during the construction of an AVL tree if the following elements are inserted in the given sequence?
35, 50, 40, 25, 30, 60, 78, 20, 28
  1. 2 left rotations, 2 right rotations
  2. 2 left rotations, 3 right rotations
  3. 3 left rotations, 2 right rotations
  4. 3 left rotations, 1 right rotation
Answer & explanation →
Q73. Consider the following undirected graph with vertices a, b, c, f, g, h and edges:
a–b, a–c, a–f, b–c, b–f, b–h, c–g, f–g, f–h, g–h
The following depth-first search (DFS) sequences are given:
(A) abcghf
(B) abfchg
(C) abfhgc
(D) afghbc
Which of the following is correct?
  1. (A), (B) and (D) only
  2. (A), (B), (C) and (D)
  3. (B), (C) and (D) only
  4. (A), (C) and (D) only
Answer & explanation →
Q85. Consider the following algorithms and their running times. Which one of the following is correct?
List IList II
A. Breadth-first searchI. Θ(V + E)
B. Rabin–Karp algorithmII. O(V + E)
C. Depth-first searchIII. Θ((n − m + 1)m)
D. Heap sort (worst case)IV. O(n²)
E. Quick sort (worst case)V. O(n log n)
  1. A-III, B-II, C-I, D-IV, E-V
  2. A-II, B-III, C-I, D-IV, E-V
  3. A-II, B-III, C-I, D-V, E-IV
  4. A-III, B-I, C-II, D-IV, E-V
Answer & explanation →
Q87. Consider the following statements on approximation algorithms:
Statement I: APPROX-VERTEX-COVER is a polynomial-time 2-approximation algorithm.
Statement II: APPROX-TSP-TOUR is a polynomial-time 3-approximation algorithm for the travelling salesman problem with the triangle inequality.
Which of the following is correct?
  1. Statement I true and Statement II false
  2. Statement I and Statement II true
  3. Statement I false and Statement II true
  4. Statement I and Statement II false
Answer & explanation →

Answer key

  1. 52 – C
  2. 53 – B
  3. 54 – A
  4. 55 – B
  5. 56 – C
  6. 57 – B
  7. 58 – D
  8. 59 – C
  9. 73 – D
  10. 85 – C
  11. 87 – A