Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Recursive Algorithm: Let T(n) be the time to compute r(n). Recursion tree shows that r(n) needs r(n-1), r(n-2),.., r(0). Therefore T(n) = T(n-1)+T(n-2)+ +T(0) and
Recursive Algorithm: Let T(n) be the time to compute r(n). Recursion tree shows that r(n) needs r(n-1), r(n-2),.., r(0). Therefore
T(n) = T(n-1)+T(n-2)+ +T(0) and T(0) =1 (*)
Prove by induction that the solution of equation (*) is T(n) = 2^n
Therefore recursion algorithm has running time T(n) = Q(2^n), which is too slow
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started