UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Unit 7: Data Structures and Algorithms PYQ (June 2024 (Cancelled Exam))
Q3. For each function below, let n be the least integer such that f(x) is O(xⁿ). Arrange the functions in increasing order of n:
A. f(x) = 3x³ + (log x)⁴
B. f(x) = (x⁵ + x² + 1)/(x³ + 1)
C. f(x) = (x³ + x² + 1)/(x² + 1)
D. f(x) = (x² + 5 log x)/(x² + 1)
Choose the correct answer from the options given below:
A. f(x) = 3x³ + (log x)⁴
B. f(x) = (x⁵ + x² + 1)/(x³ + 1)
C. f(x) = (x³ + x² + 1)/(x² + 1)
D. f(x) = (x² + 5 log x)/(x² + 1)
Choose the correct answer from the options given below:
- D, C, A, B
- D, C, B, A
- B, C, A, D
- B, A, C, D
Q14. f(n) = a·f(n/b) + g(n) is a divide-and-conquer recurrence. Match the algorithms in List I with their recurrences in List II.
| List I | List II |
|---|---|
| A. Binary Search | I. f(n) = 7f(n/2) + 15n²/4 |
| B. Find maximum and minimum of a sequence | II. f(n) = 2f(n/2) + n |
| C. Merge Sort | III. f(n) = 2f(n/2) + 2 |
| D. Fast Matrix Multiplication | IV. f(n) = f(n/2) + 2 |
- A-I, B-II, C-III, D-IV
- A-II, B-III, C-IV, D-I
- A-III, B-IV, C-I, D-II
- A-IV, B-III, C-II, D-I
Q16. The height of a binary search tree built by inserting the words banana, peach, apple, pear, coconut, mango and papaya (in this order, alphabetical comparison) is:
- 2
- 3
- 4
- 5
Q41. How much time does an algorithm using 2⁵⁰ bit operations need if each bit operation takes 2⁻³⁸ seconds?
- 1 hour
- 10 minutes
- 30 minutes
- 1.5 hours
Q51. A lower-triangular sparse matrix is one:
- in which all the non-zero elements lie only on the leading diagonal
- in which all the non-zero elements lie above the leading diagonal
- in which all the non-zero elements lie on or below the leading diagonal
- which is not defined for sparse matrices
Q78. Arrange the following prefix expressions in increasing order of their values:
A. + − * 2 / 8 4 3 2
B. ↑ − * 3 3 * 4 2 5
C. + − ↑ 3 2 ↑ 2 3 / 6 − 4 2
D. * + 3 + 3 ↑ 3 + 1 1 3
Choose the correct answer from the options given below:
A. + − * 2 / 8 4 3 2
B. ↑ − * 3 3 * 4 2 5
C. + − ↑ 3 2 ↑ 2 3 / 6 − 4 2
D. * + 3 + 3 ↑ 3 + 1 1 3
Choose the correct answer from the options given below:
- A, B, C, D
- B, A, C, D
- D, C, B, A
- C, D, A, B
Q84. Which of the following are true for a complete (full) binary tree?
A. It always has an odd number of vertices.
B. With i internal vertices, it has i + 1 leaves.
C. With l leaves, it has 2l − 1 vertices.
D. With 2n − 1 vertices, it has n leaves.
Choose the correct answer from the options given below:
A. It always has an odd number of vertices.
B. With i internal vertices, it has i + 1 leaves.
C. With l leaves, it has 2l − 1 vertices.
D. With 2n − 1 vertices, it has n leaves.
Choose the correct answer from the options given below:
- A, B, C Only
- B, C Only
- A, D Only
- A, B, C, D