Description
Four (4) problems to solve and complete …. SEE THE PDF DOUCMENT ATTACHED
1) Rewrite the function pentagonal using recursion and add preconditions and postconditions as comments. Then prove by induction that the recursive function you wrote is correct.
2) Determine at what point algorithm 2 becomes more efficient than algorithm 1.
3) Given the following function that evaluates a polynomial whose coefficients are stored in an array: Let n be the length of the array. Determine the number of additions and multiplications that are performed in the worst case as a function of n.
4) Assume n is the length of the array. Find the initial condition and recurrence equation that expresses the execution time for the worst case of this algorithm and then solve that recurrence.