Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

A recurrence T(n) = 8·T(n/4) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?

  1. A. Θ(n^3)
  2. B. Θ(n^2 log n)
  3. C. Θ(n^(log_4 8))
  4. D. Θ(n^2)

Correct answer: D. Θ(n^2)

Compare a = 8 with b^k = 4^2 = 16: a is smaller, so the solution is Θ(n^2). Using the wrong case of the master theorem gives one of the other options.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic