UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Unit 7: Data Structures and Algorithms PYQ (June 2025)
Q22. Consider the infix expression Q : ((A + B) ∗ D) ↑ (E − F). The equivalent postfix expression of Q is
- AB + D ∗ EF ↑ −
- AB + D ∗ − ↑ EF
- AB + DE ∗ F − ↑
- AB + D ∗ EF − ↑
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:
A. Binary Search Tree
B. AVL Tree
C. Red-Black Tree
D. B Tree
Choose the correct answer from the options given below:
- A and D Only
- A, B and D Only
- C and D Only
- B, C and D Only
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:
A. Dijkstra's algorithm
B. Kruskal's algorithm
C. Huffman coding
D. Bellman-Ford algorithm
Choose the correct answer from the options given below:
- A, B and D Only
- A, B and C Only
- C and D Only
- A and D Only
Q41. The longest common subsequence of {1,2,3,2,4,1,2} and {2,4,3,1,2,1} is
- 2,1,2,3
- 1,3,2,1
- 2,3,2,1
- 2,3,1,2,1
Q45. Match List I (Hashing Collision Handling Method) with List II (Strategy)
| List I | List II |
|---|---|
| A. Chaining | I. Check next slot |
| B. Linear Probing | II. Use the second hash function |
| C. Quadratic Probing | III. Linked list at index |
| D. Double Hashing | IV. Skip slots using quadratic step |
- A-II, B-III, C-I, D-IV
- A-II, B-III, C-IV, D-I
- A-III, B-I, C-IV, D-II
- A-IV, B-II, C-I, D-III
Q48. Maintaining a graph in memory by means of its adjacency matrix is known as
- Complete Representation
- Linked Representation
- Circular Representation
- Sequential Representation
Q49. Match List I with List II
| List I | List II |
|---|---|
| A. Circular Queue | I. Print Queue |
| B. Priority Queue | II. CPU Scheduling |
| C. Double Ended Queue | III. Dijkstra algorithm |
| D. Simple Queue | IV. Palindrome checking |
- A-II, B-III, C-I, D-IV
- A-II, B-III, C-IV, D-I
- A-III, B-II, C-I, D-IV
- A-IV, B-II, C-I, D-III
Q82. The tight asymptotic bound for the recurrence T(n) = 2T(n/4) + √n is
- Θ(√n)
- Θ(n log n)
- Θ(√n log n)
- Θ(n log √n)
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:
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:
- B, C, A, D
- B, A, C, D
- C, B, A, D
- C, B, D, A
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:
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:
- B, C, A, D
- D, B, A, C
- B, C, D, A
- C, A, B, D