GATE Computer ScienceHardGATE CS · ISRO

Consider T(n) = T(n/2) + T(n/3) + T(n/6) + n with T(1) = 1. Which bound is tight?

  1. A. Θ(n)
  2. B. Θ(n²)
  3. C. Θ(n log n)
  4. D. Θ(n log log n)

Correct answer: C. Θ(n log n)

Each level of the recursion tree has total size n(1/2 + 1/3 + 1/6) = n, and the depth is Θ(log n), so T(n) = Θ(n log n); the "fractions sum below 1 gives Θ(n)" shortcut does not apply because they sum to exactly 1.

More Algorithms questions

Exams that ask this topic