I am trying to solve the following recurrence:
T(n) = 8T(n/8) + n* log n.
I currently have done the following but am not sure if I am on the right track:
1. T(n)= 8 T(n/8) + n log n;
2. T(n)= 8^2 T(n/8^2) + n log (n/8) + n log n
3. T(n)= 8^3 T(n/8^3) + n log (n/8^2) + n log (n/8) + n log n
So the general formula came up for me as:
T(n)= 8^k T(n/8^k) + n log(n* n/8 * n/8^2 * ... * n/8^k).
And i am not sure how to continue this. I tried to rewrite the log
as n^k / 8^(k*(k+1)/2)
, but I still don't see the solution.
You are almost there. Set k = log_8(n)
then you can solve for T(n)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.