I need to find the asymptotic behavior of T(n) = 4T(n/5) + (log(n √n))5, in the form Θ(…).
I know of three ways:
- recursion tree
- master method
- recurrence
Which way is easiest? And, how I can be sure I got the right answer?
I need to find the asymptotic behavior of T(n) = 4T(n/5) + (log(n √n))5, in the form Θ(…).
I know of three ways:
Which way is easiest? And, how I can be sure I got the right answer?
For the asymptotic behavior, you can find the master theorem (if it can be applied) useful. Although in the master theorem's proof, it is using from the recursion tree, and these methods that you have written are not independent.
To using the master theorem, first simplify the not recursive part:
log(n\sqrt(n)) = log(n) + log(\sqrt(n)) = 3/2 log(n)
Hence:
T(n) = 4T(n/5) + (3/2 log(n))^5
From the master theorem, c_critic = log_5(4) = log(4)/log(5) ~ 0.86
, we know that (3/2 log(n))^5 = O(n^0.5)
such that 0.5 < c_critic
. Therefore, T(n) = Theta(n^{log(4)/log(5)}) ~ Theta(n^0.86)
.