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 IT 2008 | Question 22
- GATE | Gate IT 2008 | Question 34
- GATE | Gate IT 2008 | Question 35
- GATE | Gate IT 2008 | Question 36
- GATE | Gate IT 2008 | Question 37
- GATE | Gate IT 2008 | Question 38
- GATE | Gate IT 2008 | Question 39
- GATE | Gate IT 2008 | Question 40
- GATE | Gate IT 2008 | Question 41
- GATE | Gate IT 2008 | Question 43
- GATE | Gate IT 2008 | Question 44
- GATE | Gate IT 2008 | Question 45
- GATE | Gate IT 2008 | Question 46
- GATE | Gate IT 2008 | Question 32
- GATE | Gate IT 2008 | Question 23

