Which of the following is the solution of the recurrence T(n) = T(2n/3) + 1?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. Θ(log n)
Explanation
a = 1, b = 3/2, so n^(log_b a) = n⁰ = 1 = f(n). Master theorem case 2 gives Θ(log n) — it is like binary search with a 2/3 split.
More Data Structures and Algorithms questions
- Match the LIST-I with LIST-II
- 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…
- Select the Sorting Algorithms that are stable. (A) Quick Sort (B) Bubble Sort (C) Insertion Sort (D) Merge Sort (E) Shell Sort
- Match List - I with List - II.
- Match List I (recurrence) with List II (complexity). List I: (A) T(n) = 2T(n/2) + n, (B) T(n) = T(n/2) + 1, (C) T(n) = 2T(n/2) + 1, (D) T(n…
- Let n be the least integer such that f(x) is O(xⁿ). Arrange the following functions in increasing order of n: A. f(x) = 3x³ + (log x)⁴ B. f…