Question: CSE 2 3 3 1 Homework 3 Spring, 2 0 2 4 Write a recurrence relation describing the WORST case running time of each of

CSE 2331 Homework 3
Spring, 2024
Write a recurrence relation describing the WORST case running time of each of the following algorithms and determine the asymptotic complexity of the function defined by the recurrence relation. Justify your solution using either expansion into series (substitution) or a recursion tree. You may NOT use the Master theorem. Assume that all arithmetic operations take constant time.
Simplify and express your answer as (nk) or (nk(log2n)) wherever possible. If the algorithm takes exponential time, then just give exponential lower bounds.
WRITE YOUR ANSWERS ON A SEPARATE SHEET/FILE.
DO NOT SUBMIT A MARKED UP QUESTION SHEET/FILE.
1.
func1(A,n)
??**A= array of n integers
if )(40 then return A[n]
for ilarr1 to |??n2??| do
for jlarr1 to |??log6(n)??| do
A[i+j]larrA[i]-A[j]
end
end
xlarrfunc1(A,n-9)
return (x);
2.
func 2(A,n)
??**A= array of n integers
if )(20 then return A[n];
2xlarr0;
3 for ilarr1 to 5 do
4 for jlarr1 to n-3 do
5,A[j]larrA[j]-A[j+1];
6 end
/* Note: This recursive call in inside the for loop that starts in step 3.
7,xlarrx+func2(A,|??n5??|);
8 end
9 return (x);
 CSE 2331 Homework 3 Spring, 2024 Write a recurrence relation describing

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!