algorithm - Solving T(n)=4T(n/2)+n^2 - Stack Overflow
T(n)=4T(n/2)+n2 = n2+4[4T(n/4)+n^2/4] = 2n2+16T(n/4) = ... = k*n2+4kT(n/2k) = ...
The process stops when 2k reaches n. ==> k = log2n.
==> T(n) = O(n2logn).
Read full article from algorithm - Solving T(n)=4T(n/2)+n^2 - Stack Overflow
No comments:
Post a Comment