简体   繁体   中英

Time complexity of T(n) = 27T(n/3) + (n^3)log(n)

I need some help with this recurrence, I tried with my self and I got teta( (n^3)logn) but wolframalpha say this

递归

So I guess this is like an O( (n^3) log^2(n)). I can't use master theorem so I solved by recurrence, this is my solution.

手动解决方案

You made a mistake in the last stage. Using these properties: log(x) + log(y) = log(xy) and log(x/y) = log(x) - log(y) and log(x^y) = y log(x)`, we have the following:

sum_{i=0}{k-1} log(m/3^i) = log(m^(k-1) / (1 + 3 + 3^2 + ... + 3^(k-1))) 
= log(m^(k-1)) - log(3^k - 1) ~ (k-1) log(m) - k log(3) = Theta(log(m) * log(m))

Therefore, the time complexity is m^3 log^2(m) .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM