Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions