Question: Part a-b Unless otherwise instructed write a recurrence relation describing the worst case running time of the following algorithm and determine the asymptotic complexity of
Unless otherwise instructed write a recurrence relation describing the worst case running time of the following algorithm and determine the asymptotic complexity of the function defined by the recurrence relation. Justify your solution using the substitution method. Ali. .j] represents an array of n - j -i +1 integers starting at index i and ending at index j and Alk] represents the value at index k. (15 points each 10 free points.) a) FUNCTION F(A[1.nl) b) FUNCTION F2 (A[1..n) IF n s 20 THEN RETURN (A[n]) IF n s 20 THEN RETURN(A[l) FOR i In/4)T01n/41+ 12 DO RETURN(z) FOR i 1 TO 5 DO FOR j -1 TO n 10 DO RETURN(c) c) For this one the best you can do is to find two different functions, ge(n) and g(n), d) FUNCTION F (A[1..n) IF n s 20 THEN RETURN(A[L])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
