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

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

Show answer & explanation

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

Explanation

(A) is Θ(log n); (E) and (D) are Θ(n); (B) and (C) are Θ(n log n). So A, E, D, B, C.

More Data Structures and Algorithms questions