Question: Write a recurrence relation describing the worst case running time of each the following algorithms and make a guess about the asymptotic complexity of the

Write a recurrence relation describing the worst case running time of each the following
algorithms and make a guess about the asymptotic complexity of the functions defined by
the recurrence relation using either expanding into a series or a recursion tree.
A[idotsj] represents an array of n=j-i+1 numbers starting at index i and ending at
index j and A[k] represents the value at index k.
1.) FUNCTION F1(A[1dotsn])
IF n5 THEN RETURN(A[n])
xlarr0
FOR ilarr1 TO 5 DO
BEGIN (FOR i)
FOR jlarr1 TO n-4 DO
A[i]larrA[j]+A[j+2]
xlarrx+F1(A[1dots|??n2??|])
END
RETURN (x)
2.) FUNCTION F2(A[idotsj])
nlarrj-i+1
IF n1 THEN RETURN (A[i])
xlarrF2(A[idots|??i+2n3??|])
FOR ilarr|??n4??| TO |??n4??|+12 DO
xlarrx+A[i]
RETURN (x)
3.)FUNCTION F3(A[1dotsn])
IFn1 THEN RETURN (A[1])
FOR ilarr1TOnDO
FOR jlarr1TO|??n3??|DO
,A[i]larrA[i]-A[j]
xlarrF3(A[1..|??3n5??|])
RETURN(x)
 Write a recurrence relation describing the worst case running time of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!