GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Consider T(n) = 2T(n/2) + n/log₂n for n ≥ 2 (n a power of 2, T(1) = 1). Which is the tightest bound? (The Master theorem in its basic form does not apply.)

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

Correct answer: A. Θ(n log log n)

Level i of the recursion tree costs 2^i·(n/2^i)/log(n/2^i) = n/(log n − i). Summing over i = 0…log n − 1 gives n·H(log n) = Θ(n log log n); the extra 1/log n in f(n) shrinks the n log n answer by a log factor, not to Θ(n).

More Algorithms questions

Exams that ask this topic