GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 4.6

Recurrence dominated by leaf work

Algorithms · Asymptotic Analysis & Recurrences · Full GATE CSE 1997 paper

GATE 1997, Q4.6 2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 4.6, GATE 1997: T(1)=1 and T(n)=2T(floor (n/2))+sqrt (n) for n≥2. Choose O(sqrt n), O(n), O(log n), none.
Tap to enlarge
Your answer
Answer & solution

Answer: B: Θ(n) (no official key was published)

At recursion depth j there are roughly 2j subproblems of size n/2j. Their combined nonrecursive work is sqrt (n)·2j/2, increasing geometrically toward the leaves. Summing through depth about log 2 n gives O(n), and there are Θ(n) leaves each contributing constant work, providing Ω(n). Hence T(n)=Θ(n), so B. Equivalently the Master theorem has nlog 2 2=n and toll n1/2, which is polynomially smaller; rounding does not change the asymptotic order.

Original paper, page 4