Consider this recurrence relation:
T(n) = T(n-1) * T(n-2) n>2
T(1) = 1, T(2) = 2
How i can solve it? And finally: T(n) = O(?)
I think we should take log of both sides or something like. But i have no idea to continue.
You start by taking the logarithm of both parts to get:
log(T(n)) = log(T(n-1)) + log(T(n-2))
Now you substitute it with log(T(n))
to K(n)
so you have to solve the problem K(n) = K(n-1) + K(n-2) . Doing similar thing you will get the solution
K(n) = c1 * F(n) + c2 * L(n), where F(n) is a Fibonacci number and L(n) is a Lucas number and c1, c2 are just some constants. So now to get your answer you just have to revert the logarithm.
So your solution is e^(c1 * F(n) + c2 * L(n))
. Following my previous explanation the complexity of this is O(e^(phi^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.