GATE / CS ARCHIVE

GATE CSE 2006 / QUESTION 51

Square-root divide-and-conquer recurrence

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

GATE 2006, Q51 2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 51, GATE 2006: For integers n>1, T(n)=2T(⌊√n⌋)+1 and T(1)=1. What is the asymptotic growth?
Options:
(A) Θ(log log n)
(B) Θ(log n)
(C) Θ(√n)
(D) Θ(n)
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. After h repeated floor-square-root steps, the subproblem size is floor(n1/2^h). For n≥2 it first reaches 1 when n<22^h, so h=floor(log₂(log₂ n))+1.

2. The recurrence tree is a full binary tree of height h. Every node contributes one, including the T(1)=1 leaves, so T(n)=2h+1−1. Because log₂ n<2h≤2 log₂ n, this is Θ(log n), option B.

3. Teaching check: The depth is Θ(log log n), but exponentiating that Θ statement alone would not justify Θ(log n). The sharper h=log₂(log₂ n)+O(1) bound controls the number of leaves within constant factors. Floor rounding is included explicitly and ensures termination at the stated base case.

Original paper, page 7