Question: 1. Consider the following algorithm: Precondition: A is a list of integers. (The first index in A is 0.) Algorithml(A): if len(A) 2: return (0

1. Consider the following algorithm: Precondition: A is a list of integers. (The first index in A is 0.) Algorithml(A): if len(A) 2: return (0 1. 2. 3.m-len(A)// 4 4. s = Algorithm! (A[0 .. m-1]) for i - m to 3*m - 1: 6 7. 8. s=s+A[i] ssAlgorithml(A[3*m .. len(A)-1]) return s Let T(n) denote the worst-case running time of Algorithml on inputs of size n (a) Write a recurrence relation satisfied by T. You may assume that len(A) is a power of 4. Make sure to justify that your recurrence is correct (refer to the algorithm to describe how you obtained your answer) (b) Give an asymptotic upper-bound for the worst-case running time of the algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
