UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Unit 7: Data Structures and Algorithms PYQ (December 2024)
Q26. Choose the correct statement(s)
A. A problem which is NP-Complete will have the property that it can be solved in polynomial time iff all other NP-complete problems can also be solved in polynomial time.
B. All NP-complete problems are NP-hard problems.
C. If an NP-hard problem can be solved in polynomial time, then all NP-complete problems can be solved in polynomial time.
D. All NP-hard problems are not NP-complete.
Choose the correct answer from the options given below:
A. A problem which is NP-Complete will have the property that it can be solved in polynomial time iff all other NP-complete problems can also be solved in polynomial time.
B. All NP-complete problems are NP-hard problems.
C. If an NP-hard problem can be solved in polynomial time, then all NP-complete problems can be solved in polynomial time.
D. All NP-hard problems are not NP-complete.
Choose the correct answer from the options given below:
- A, C only
- B, D only
- A, B, C only
- A, B, C, D
Q30. Consider the binary tree: A is the root with left child B and right child C; C has left child D and right child E; E has right child F; F has left child G and right child H. What will be the inorder traversal?
- BADCEGFH
- GHFEDCBA
- BACDEGFH
- GHFDEBCA
Q33. Which of the following uses only increment operations for adding and removing elements at either end?
- Queues
- Stacks
- Priority Queues
- Deques
Q46. Match List I with List II
| List I | List II |
|---|---|
| A. Breadth First Search | I. LISP |
| B. Depth First Search | II. Syntax tree |
| C. Prefix | III. Stack |
| D. Infix | IV. Queue |
- A-III, B-IV, C-I, D-II
- A-III, B-IV, C-II, D-I
- A-IV, B-II, C-III, D-I
- A-IV, B-III, C-I, D-II
Q63. Which of the following is NOT a divide and conquer method?
- Binary Search
- Merge Sort
- Quick Sort
- Heap Sort
Q67. Arrange the following steps of the inorder traversal of a binary tree in the correct order.
A. Visit the left subtree
B. Visit the root node
C. Visit the right subtree
D. Start traversing by visiting the nodes in the rooted tree
E. Repeat the above three steps.
Choose the correct answer from the options given below:
A. Visit the left subtree
B. Visit the root node
C. Visit the right subtree
D. Start traversing by visiting the nodes in the rooted tree
E. Repeat the above three steps.
Choose the correct answer from the options given below:
- A, B, C, D, E
- E, A, B, C, D
- D, A, B, C, E
- D, A, E, B, C
Q71. Which of the following algorithms are based on Breadth First Search (BFS)?
A. Prim's algorithm
B. Kruskal's algorithm
C. Dijkstra's algorithm
D. Greedy algorithms
E. Dynamic Programming
Choose the correct answer from the options given below:
A. Prim's algorithm
B. Kruskal's algorithm
C. Dijkstra's algorithm
D. Greedy algorithms
E. Dynamic Programming
Choose the correct answer from the options given below:
- A & B only
- A, C & D only
- D & E only
- A & C only
Q72. Which of the following is the solution of the recurrence relation T(n) = T(2n/3) + 1?
- Θ(n²)
- Θ(log n)
- Θ(n log n)
- Θ(n3/2)
Q81. Which of the following description(s) is/are true?
A. Red-Black Tree – guarantees worst case O(log n) time for search, insert & delete.
B. Trie – used for efficient prefix-based searches.
C. AVL Tree – self-balancing binary search tree with stricter balance criteria.
D. B-Tree – allows efficient search, insert, delete operations in disk-based systems.
Choose the correct answer from the options given below:
A. Red-Black Tree – guarantees worst case O(log n) time for search, insert & delete.
B. Trie – used for efficient prefix-based searches.
C. AVL Tree – self-balancing binary search tree with stricter balance criteria.
D. B-Tree – allows efficient search, insert, delete operations in disk-based systems.
Choose the correct answer from the options given below:
- A & B only
- C & D only
- B only
- A, B, C & D
Q86. Match List I with List II
| List I | List II |
|---|---|
| A. Insertion Sort | I. O(log n) |
| B. Binary Search | II. O(n²) |
| C. Quick Sort | III. O(n) |
| D. Selection Sort | IV. O(n log n) |
- A-III, B-I, C-IV, D-II
- A-II, B-III, C-I, D-IV
- A-I, B-II, C-IV, D-III
- A-II, B-III, C-IV, D-I