摘要:
对于T(n) = a*T(n/b)+c*n^k;T(1) = c 这样的递归关系,有这样的结论:if (a > b^k) T(n) = O(n^(logb(a)));logb(a)b为底a的对数if (a = b^k) T(n) = O(n^k*logn);if (a < b^k) T(n) = O(n^k);a=25; b = 5 ; k=2a==b^k 故T(n)=O(n^k*logn)=O(n^2*logn)T(n) = 25T(n/5)+n^2= 25(25T(n/25)+n^2/25)+n^2= 625T(n/25)+n^2+n^2 = 625T(n/25) + 2n^2 阅读全文