942 views
2 2 votes
T(n) = 2*T(n/2) + n*logn
 please explain

1 Answer

2 2 votes

For T(n)= aT(n/b)+n^k log^p n 

for a>=1, b>1, k>=0,p real no.

compare a and b^k,

                                    1. if a>b^k then T(n)=n^(log a/log b)

                                    2. if a=b^k then 

                                                     .if p>-1, T(n)=n^(log a/log b) log^(p+1) n

                                                     .if p=-1, T(n)=n^(log a/log b)  log log n

                                                     .if p<-1, T(n)=n^(log a/log b)

                                    3. if a<b^k then

                                                      .if p>=0, T(n)=n^k log^p n

                                                      .if p<0, T(n)=n^k



compare a and b^k i.e a=2, b^k=2^1 which implies a=b^k

Since, p >=(-1), so, T(n)=n log^2 n

Position:
Show:

Related questions

1 1 vote
1 1 answer
3.3k
3.3k views
iarnav asked Jul 29, 2017
3,317 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...
3 3 votes
1 answers 1 answer
854
854 views
sampad asked Nov 23, 2015
854 views
Solve the equation: $$a_n = 5a_{n/3} + 7, \;\; a_1 = 5$$Note: $a_0$ is not given.
0 0 votes
0 0 answers
588
588 views
radha gogia asked Jan 7, 2016
588 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)...
4 4 votes
2 2 answers
4.1k
4.1k views
radha gogia asked Jan 4, 2016
4,100 views
T(n)=2&radic;nT(&radic;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) + 1Now T(2m)/2m=S(m), so equation becomes S...