GATE / CS ARCHIVE

GATE CSE 2009 / QUESTION 35

Geometric-sum recurrence

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

GATE 2009, Q35 2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 35, GATE 2009: T(n)=n for n≤3, otherwise T(n)=T(n/3)+cn with fixed c>0. Which growth rate? A Θ(n); B Θ(n log n); C Θ(n²); D Θ(n² log n).
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Expanding T(n)=T(n/3)+cn gives cn+cn/3+cn/9+... plus a constant-size base case. For fixed positive c this is bounded above by(3c/2)n+O(1) and below by cn. Hence Θ(n), A, with routine integer rounding not changing the asymptotic result.

The recursion tree has only one child, whose size shrinks by 3. Work by level is cn, cn/3, cn/9, … . The geometric sum is below cn/(1−1/3)=1.5cn, while the root alone contributes cn. These upper and lower linear bounds establish Θ(n). The depth is logarithmic, but multiplying n by that depth overcounts because work per level decreases rather than remaining n.

Original paper, page 8