Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

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

What is the solution of T(n)=2T(n/2)+nT(n) = 2T(n/2) + n?

Asymptotic Analysis

Pick an option to check your answer.

Master theorem: a=2a = 2, b=2b = 2, f(n)=nf(n) = n. Since nlog⁡ba=nlog⁡22=nn^{\log_b a} = n^{\log_2 2} = n and f(n)=Θ(n)f(n) = \Theta(n), this is case 2: T(n)=Θ(nlog⁡n)T(n) = \Theta(n\log n) — the merge sort recurrence.

Why not the others

  • Θ(n)\Theta(n) ignores the log⁡n\log n levels, each doing Θ(n)\Theta(n) work.
  • Θ(n2)\Theta(n^2) fits T(n)=4T(n/2)+nT(n) = 4T(n/2) + n.
  • Θ(log⁡n)\Theta(\log n) fits binary search, T(n)=T(n/2)+1T(n) = T(n/2) + 1.

Report an error

GATE CS · Algorithms · Asymptotic Analysis