GATE Computer ScienceVery hardGATE CS (PYQ pattern)

The solution of the recurrence T(n) = 2T(n/2) + n/log n (with T(1) = 1, logs base 2) is:

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

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

At level i the cost is n/(log n − i), so the total is n × (1/log n + 1/(log n − 1) + … + 1) = n × H(log n) = Θ(n log log n). The master theorem does not apply because f(n) is only polylogarithmically smaller than n.

More Algorithms questions

Exams that ask this topic