Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!