GATE | Gate IT 2008 | Question 42
When n = 22k for some k ≥ 0, the recurrence relation
T(n) = √(2) T(n/2) + √n, T(1) = 1
evaluates to :
(A) √(n) (log n + 1)
(B) √(n) (log n )
(C) √(n) log √(n)
(D) n log √(n)
Answer: (A)
Explanation: Please note that the question is asking about exact solution. Master theorem provides results in the form of asymptotic notations. So we can’t apply Master theorem here. We can solve this recurrence using simple expansion or recurrence tree method.
T(n) = √(2) T(n/2) + √n
= √(2) [√(2) T(n/4) + √(n/2) ] + √n
= 2 T(n/4) + √2 √(n/2) +√n
= 2[ √2 T(n/8) + √(n/4) ]+√2 √(n/2)+√n
= √(2^3) T(n/8)+ 2 √(n/4) + √2 √(n/2) +√n
= √(2^3) T(n/8)+√n +√n +√n
= √(2^3) T(n/(2^3))+3√n
.............................................
= √(2^k) T(n/(2^k))+k√n
= √(2^logn) + logn √n
= √n + logn √n
= √n(logn +1)
Recommended Posts:
- GATE | GATE CS 2008 | Question 35
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 17
- GATE | GATE CS 2008 | Question 16
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 14
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 12
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 10
- GATE | GATE CS 2008 | Question 9
- GATE | GATE CS 2008 | Question 8
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 5



