773 views
1 votes
1 votes
Find the solution of recurrence $T(n) = 4T(\frac{n}{2}) + n^{2}$ by substitution method.

1 Answer

Best answer
2 votes
2 votes

T(n)=4T($\frac{n}{2}$) + n2

        =4{4 * T($\frac{n} {2^2}$) + ($\frac{n}{2}$)2}+ n2

         =42 * T($\frac{n} {2^2}$) + n2 + n2

         =42{4 * T($\frac{n} {2^3}$) + ($\frac{n}{2^2}$)2}+ n2 +n2

         =43 * T($\frac{n} {2^3}$) + n2 + n2 + n2

         =4k * T($\frac{n} {2^k}$) + k * n2

so,$\frac{n} {2^k}$ = 1

    => k= $\log_{2}n$

now T(n)=4k * T($\frac{n} {2^k}$) + k * n2

                =4$\log_{2}n$  *  T(1) + $\log_{2}n$ * n2

                =2$\log_{2}n^2$ + $\log_{2}n$ * n2

                =n2 + $\log_{2}n$  * n2

                =O(n2 $\log_{2}n$ )

selected by

Related questions

0 votes
0 votes
1 answer
1
akash.dinkar12 asked Jun 28, 2019
469 views
Obtain asymptotically tight bounds on $lg\ (n!)$ without using Stirling’s approximation. Instead, evaluate the summation $\sum_{k=1}^{n} lg\ k$.
0 votes
0 votes
0 answers
2
1 votes
1 votes
0 answers
4
akash.dinkar12 asked Apr 4, 2019
175 views
Is the function $\lceil$ $lg$ $n$ $\rceil$$!$ polynomially bounded ? Is the function $\lceil$ $lg$ $lg$ $n$ $\rceil$$!$ polynomially bounded ?