1 flag 4,118 views
4 4 votes

T(n)=2√nT(√n)+n 

In this If we take n=2m then and I divide the entire equation by n so I will get 

T(2m)/2m=2T(2m/2) + 1

Now T(2m)/2m=S(m), so equation becomes 

S(m)=2S(m/2)+1 therefore S(m)=⊝(m) so T(2m)/2m=⊝(m)  , T(2m)=2m⊝(logn)=⊝(nlogn)

Is this correct approach or not ,since I am unable to do it with tree method .

  • 🚩 Duplicate | 👮 Hira Thakur | 💬 “https://gateoverflow.in/268663/t-n-sqrt-n-t-sqrt-n-n”

2 Answers

6 6 votes

O( n log log n )
Using Back substitution
 

1 1 vote

First of all, we use Master's theorem, when the recurrence are of form T(n) = a T(n/b) + f(n)

Tree method is much helpful when the problem is divided into two uneven fractions like

T(n) = T(n/2) + T(n/3) + c

But to solve square root recurrence better you go with substitution.


Now, let me tell you, what is problem with you approach,

S(m) =  T(2m)/2m

S(m/2) =  T(2m/2)/2m/2

this way T(2m/2)   will become  2m/2 S(m/2)  not simply S(m/2).

So your recurrence will become

S(m)=2*2m/2*S(m/2)+1

now to solve this recurrence, you cannot use master's theorem, so go for substitution method only.

For more help refer this link : http://cs.stackexchange.com/questions/6410/solving-a-recurrence-relation-with-%E2%88%9An-as-parameter

 
Position:
Show:

Related questions

0 0 votes
0 0 answers
591
591 views
radha gogia asked Jan 7, 2016
591 views
T(n)=2T(n-1)+n-1, T(1)=1 , n>=2T(n)=2kT(n-k)+2(k-1)(n-(k-1))+2(k-2)(n-(k-2))+.......+nNow k=n-1T(n)=2(n-1)(1)+2(n-2)(2)+2(n-3)(3)+.......+2(n-n)(n)T(n)=2(n)[ 1/1 + 2/2(2)...
1 1 vote
1 answers 1 answer
713
713 views
radha gogia asked Dec 30, 2015
713 views
T(n)=T(n-3)+cn2T(n-3)=T(n-6)+c(n-3)2T(n-6)=T(n-9)+c(n-6)2Continuing like this I am getting T(n)=T(n-3k)+cn2+c(n-3k)2+c(n-(3k+3))2+c(n-(3k+6))2+c(n-(3k+9))2+......Now let ...
1 1 vote
0 0 answers
387
387 views
mitesh kumar asked Dec 22, 2018
387 views
https://gateoverflow.in/33989/how-to-solve-below-recurrence-relation
1 1 vote
1 1 answer
3.3k
3.3k views
iarnav asked Jul 29, 2017
3,339 views
Given RR as -T(n) = 2T(n/2)+n ; n>1T(1) = 1Solve this using only BACK SUBSTITUTION method? Note - I am stuck at T(n)= 2^k.T(n/2^k)+(2^k-1).nand I'm putting 2^k=n Please h...