UGC-NET Jan 2017 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0027

The asymptotic upper bound solution of the recurrence relation given by $T(n) = 2T \left( \frac{n}{2} \right) +\frac{n}{\lg \: n}$ is
  1. A
    $O(n^2)$
  2. B
    $O(n \:\lg \: n )$
  3. C
    $O(n \:\lg \:\lg \: n)$
  4. D
    $O(\lg \:\lg \: n)$

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionThe master theorem does not apply: \(n/\lg n\) is smaller than \(n\) but not by a polynomial factor. Use the recursion tree. At depth \(i\) there are \(2^i\) subproblems of size \(n/2^i\), costing\[2^i\cdot\frac{n/2^i}{\lg(n/2^i)}=\frac{n}{\lg n-i}.\]Summing over \(i=0,\dots,\lg n-1\):\[T(n)=n\sum_{k=1}^{\lg n}\frac1k=n\,H_{\lg n}=\Theta(n\lg\lg n).\]Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com