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 (June 2025)

10 questions · answer key at the end · updated 11 Oct 2026
Q22. Consider the infix expression Q : ((A + B) ∗ D) ↑ (E − F). The equivalent postfix expression of Q is
  1. AB + D ∗ EF ↑ −
  2. AB + D ∗ − ↑ EF
  3. AB + DE ∗ F − ↑
  4. AB + D ∗ EF − ↑
Answer & explanation →
Q23. Which of the following trees are height balanced?
A. Binary Search Tree
B. AVL Tree
C. Red-Black Tree
D. B Tree
Choose the correct answer from the options given below:
  1. A and D Only
  2. A, B and D Only
  3. C and D Only
  4. B, C and D Only
Answer & explanation →
Q37. Which of the following algorithms use the Greedy strategy?
A. Dijkstra's algorithm
B. Kruskal's algorithm
C. Huffman coding
D. Bellman-Ford algorithm
Choose the correct answer from the options given below:
  1. A, B and D Only
  2. A, B and C Only
  3. C and D Only
  4. A and D Only
Answer & explanation →
Q41. The longest common subsequence of {1,2,3,2,4,1,2} and {2,4,3,1,2,1} is
  1. 2,1,2,3
  2. 1,3,2,1
  3. 2,3,2,1
  4. 2,3,1,2,1
Answer & explanation →
Q45. Match List I (Hashing Collision Handling Method) with List II (Strategy)
List IList II
A. ChainingI. Check next slot
B. Linear ProbingII. Use the second hash function
C. Quadratic ProbingIII. Linked list at index
D. Double HashingIV. Skip slots using quadratic step
  1. A-II, B-III, C-I, D-IV
  2. A-II, B-III, C-IV, D-I
  3. A-III, B-I, C-IV, D-II
  4. A-IV, B-II, C-I, D-III
Answer & explanation →
Q48. Maintaining a graph in memory by means of its adjacency matrix is known as
  1. Complete Representation
  2. Linked Representation
  3. Circular Representation
  4. Sequential Representation
Answer & explanation →
Q49. Match List I with List II
List IList II
A. Circular QueueI. Print Queue
B. Priority QueueII. CPU Scheduling
C. Double Ended QueueIII. Dijkstra algorithm
D. Simple QueueIV. Palindrome checking
  1. A-II, B-III, C-I, D-IV
  2. A-II, B-III, C-IV, D-I
  3. A-III, B-II, C-I, D-IV
  4. A-IV, B-II, C-I, D-III
Answer & explanation →
Q82. The tight asymptotic bound for the recurrence T(n) = 2T(n/4) + √n is
  1. Θ(√n)
  2. Θ(n log n)
  3. Θ(√n log n)
  4. Θ(n log √n)
Answer & explanation →
Q83. When developing a dynamic programming algorithm, the sequence of steps followed is:
A. Construct an optimal solution from computed information.
B. Recursively define the value of an optimal solution.
C. Characterize the structure of an optimal solution.
D. Compute the value of an optimal solution, typically in a bottom-up fashion.
Choose the correct answer from the options given below:
  1. B, C, A, D
  2. B, A, C, D
  3. C, B, A, D
  4. C, B, D, A
Answer & explanation →
Q86. The correct sequence of constructing a Huffman tree is
A. Repeat until root formed
B. Create leaf nodes
C. Build priority queue
D. Combine lowest frequency nodes
Choose the correct answer from the options given below:
  1. B, C, A, D
  2. D, B, A, C
  3. B, C, D, A
  4. C, A, B, D
Answer & explanation →

Answer key

  1. 22 – D
  2. 23 – D
  3. 37 – B
  4. 41 – C
  5. 45 – C
  6. 48 – D
  7. 49 – B
  8. 82 – C
  9. 83 – D
  10. 86 – C