Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

URGENT! Consider the following recursive function that takes as arguments an arr

ID: 3771959 • Letter: U

Question

URGENT!

Consider the following recursive function that takes as arguments an array L and two nonnegative integers first and last, that serve as indices into L. Therefore, if L has length then first and last arc guaranteed to be in the range 0 through n - 1. What is the value returned by the function call strangeSum(L, 0, 3) where L is the array [1, 4, 2, 3). Write a recurrence relation describing the running time the function call strangeSum(L, 0, n - 1) oil an array L of length n. Solve the recurrence in (b) to obtain the running time of the function call strangeSum(L, 0, n - 1), in terms of n, the length of the given array L.

Explanation / Answer

a)9

b)the relation would be T(n)+T(n-1).

c)