Question: 2. Consider the following function: Func2(A, n) / A is an array of integers 1 if (n 1) then return (0); 2 k Random (n);
2. Consider the following function: Func2(A, n) /" A is an array of integers 1 if (n 1) then return (0); 2 k Random (n); 4 for i 1 to In/2 do 5 | Ali] A[i] + Ali + ln/21; 7 end Func2(A, k-1) 9 return (s); (a) What is the asymptotic worst case running time of Func2? (b) What is the asymptotic expected running time of Func2? Justify your solution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
