Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Algorithms
  • Master theorem
  • Medium

What is the solution of the recurrence T(n)=8T(n/2)+n2T(n) = 8T(n/2) + n^2?

Asymptotic Analysis

Pick an option to check your answer.

Here a=8a = 8, b=2b = 2 and f(n)=n2f(n) = n^2. Compare f(n)f(n) with nlog⁡ba=nlog⁡28=n3n^{\log_b a} = n^{\log_2 8} = n^3. Since n2=O(n3−ϵ)n^2 = O(n^{3 - \epsilon}), case 1 of the master theorem applies and T(n)=Θ(n3)T(n) = \Theta(n^3): the eight recursive calls dominate the work done at each level.

Why not the others

  • Θ(n2log⁡n)\Theta(n^2 \log n) is case 2, which needs f(n)=Θ(nlog⁡ba)f(n) = \Theta(n^{\log_b a}); here ff is smaller.
  • Θ(n2)\Theta(n^2) is case 3, which needs f(n)f(n) to dominate n3n^3.
  • Θ(n3log⁡n)\Theta(n^3 \log n) would need an extra logarithmic factor in f(n)f(n).

Report an error

GATE CS · Algorithms · Asymptotic Analysis