edited by
475 views

1 Answer

2 votes
2 votes

put n=2^k eq-1

B(2^k) = 3B(2^k/k) + 2^k

B(2^k/k) = 3B(2^k/k^2) + (2^k)/k

B(2^k/k^2) = 3B(2^k/k^3) + (2^k)/k^2

................=3B(2^k/k^x) + (2^k)/k^(x-1)

put 2^k/k^x=2...........eq-2

               = 3B(2) + (2^k)/k^(x-1)+...........+  (2^k)/k^2 + (2^k)/k  + 2^k

               =3*1+(2^k)[1/k^0 + 1/k^1  +  1/k^2+  1/k^3  +1/k^4 +1 /k^(x-1)]    apply g.p formula=a(1-r^n)/1-r

                =3+(2^k)[(1-(1/k)^x)/1-1/k]

                =3+(2^k) *k*[(k^x-1)]/(k-1) k^x

           put k^x=2*2^k  from eq-2

                  =(k.2^K)/(k-1)

put 2^k=n from eq-1

             =n.logn  is the answer

Related questions

1 votes
1 votes
1 answer
1
sripo asked Nov 14, 2018
1,631 views
T(n)=T(n/2)+2; T(1)=1when n is power of 2 the correct expression for T(n) is:a) 2(logn+1)b) 2lognc)logn+1d)2logn+1