What does this algorithm


Consider the following recursive algorithm.

Algorithm S(n)

if n==1 return 1

else return S(n-1) + n*n*n

a) What does this algorithm compute?

b) Set up and solve a recurrence relation for the number of times the algorithm's basic operation is executed.

c) How does this algorithm compare with the non-recursive algorithm for computing this function in terms of time efficiency and space efficiency?

Solution Preview :

Prepared by a verified Expert
Business Management: What does this algorithm
Reference No:- TGS02450596

Now Priced at $10 (50% Discount)

Recommended (94%)

Rated (4.6/5)