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 2024 (Cancelled Exam))

7 questions · answer key at the end · updated 11 Oct 2026
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:
  1. D, C, A, B
  2. D, C, B, A
  3. B, C, A, D
  4. B, A, C, D
Answer & explanation →
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 IList II
A. Binary SearchI. f(n) = 7f(n/2) + 15n²/4
B. Find maximum and minimum of a sequenceII. f(n) = 2f(n/2) + n
C. Merge SortIII. f(n) = 2f(n/2) + 2
D. Fast Matrix MultiplicationIV. f(n) = f(n/2) + 2
  1. A-I, B-II, C-III, D-IV
  2. A-II, B-III, C-IV, D-I
  3. A-III, B-IV, C-I, D-II
  4. A-IV, B-III, C-II, D-I
Answer & explanation →
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:
  1. 2
  2. 3
  3. 4
  4. 5
Answer & explanation →
Q41. How much time does an algorithm using 2⁵⁰ bit operations need if each bit operation takes 2⁻³⁸ seconds?
  1. 1 hour
  2. 10 minutes
  3. 30 minutes
  4. 1.5 hours
Answer & explanation →
Q51. A lower-triangular sparse matrix is one:
  1. in which all the non-zero elements lie only on the leading diagonal
  2. in which all the non-zero elements lie above the leading diagonal
  3. in which all the non-zero elements lie on or below the leading diagonal
  4. which is not defined for sparse matrices
Answer & explanation →
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:
  1. A, B, C, D
  2. B, A, C, D
  3. D, C, B, A
  4. C, D, A, B
Answer & explanation →
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:
  1. A, B, C Only
  2. B, C Only
  3. A, D Only
  4. A, B, C, D
Answer & explanation →

Answer key

  1. 3 – B
  2. 14 – D
  3. 16 – C
  4. 41 – A
  5. 51 – C
  6. 78 – B
  7. 84 – D