Data Structures & AlgorithmsHardGATE CS · TCS NQT
A recurrence T(n) = 8·T(n/3) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?
- A. Θ(n^2 log n)
- B. Θ(n^2)
- C. Θ(n^3)
- D. Θ(n^(log_3 8))
Correct answer: B. Θ(n^2)
Compare a = 8 with b^k = 3^2 = 9: a is smaller, so the solution is Θ(n^2). Using the wrong case of the master theorem gives one of the other options.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- A recurrence T(n) = 5·T(n/3) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 8·T(n/4) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 7·T(n/4) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 4·T(n/3) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 3·T(n/3) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 6·T(n/3) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?