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.