GATE Computer ScienceEasyGATE CS (PYQ pattern)

Let T(n) = 2T(√n) + log₂ n for n > 2, with T(2) = 1, where n is always of the form 2^(2^k). What is the exact value of T(2^16)?

  1. A. 64
  2. B. 31
  3. C. 80
  4. D. 96

Correct answer: C. 80

Put m = log₂ n and S(m) = T(2^m): S(m) = 2S(m/2) + m, S(1) = 1. So S(2) = 4, S(4) = 12, S(8) = 32, S(16) = 80 (= m log₂ m + m). Forgetting the base case gives 64; dropping the factor 2 gives 16+8+4+2+1 = 31.

More Algorithms questions

Exams that ask this topic