GATE 2014 CS (CS2) – Question 23
Which gives the solution of $T(n)=2T(n/2)+\log n$, T(1) = 1?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) $\Theta(n)$
Explanation
The comparison function is n^(log₂2)=n. Since log n grows polynomially slower than n, the Master Theorem’s first case applies. Thus **T(n)=Θ(n),A**. Alternatively, the many constant-cost leaves dominate the summed level costs.