edited by
17,331 views
73 votes
73 votes

When $n = 2^{2k}$ for some $k \geqslant 0$, the recurrence relation

$T(n) = √(2) T(n/2) + √n$, $T(1) = 1$

evaluates to :

  1. $√(n) (\log n + 1)$
  2. $√(n) \log n$
  3. $√(n) \log √(n)$
  4. $n \log √n$
edited by

9 Answers

2 votes
2 votes
As T(1) =1 , Checking if options are giving 1 at n=1:

A) giving 1

B),C),D) giving 0.
To be on safer side lets check for n=2:

T(2)=2 √2
(by putting n=2 in given recurrence)

by checking options we will find that only A) is giving 2 √2
0 votes
0 votes

using masters theorem we get

a =√2 b =2

n ^( log b a)= n^ ( log 2 √2 ) = n ^(1/2 log 2 2) = n 1/2 =√n

f(n) = √n

So second rule of masters theorem applies

T(n) =θ(√n log n)

edited by
Answer:

Related questions

15 votes
15 votes
4 answers
2
Ishrat Jahan asked Oct 29, 2014
9,241 views
Consider the code fragment written in C below :void f (int n) { if (n <=1) { printf ("%d", n); } else { f (n/2); printf ("%d", n%2); } }What does f(173) print?$010110101$...