All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · June 2024 Re-Exam

Arrange the following recurrence relations in increasing order of their time complexity:
(A) T(n) = T(n/2) + 1
(B) T(n) = 2T(n/2) + n
(C) T(n) = 3T(n/3) + n
(D) T(n) = 2T(n/2) + √n
(E) T(n) = T(n−1) + 1
Choose the correct answer from the options given below:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. (A), (E), (D), (B), (C)

Explanation

(A) Θ(log n); (E) Θ(n); (D) Θ(n) by Master theorem case 1; (B) and (C) Θ(n log n). Increasing order: A, E, D, B, C.

More Data Structures and Algorithms questions