Question: Question 1: Consider the following algorithm // L is a list and n is its length // // For the purpose of this assignment we

Question 1: Consider the following algorithm // L is a list and n is its length // // For the purpose of this assignment we assume that n= 4**k , for k>1// Alg1(L.n) remove the smallest and largest element from L f n-2>(4"k)/2 call Alg1 (L, n-2) What is the algorithm intended to do? Is it correct? If it is not correct discover the error(s) when trying to prove correctness and fix it (them). Then, reprove the correctness. What is its time complexity? Can it be improved? You may use any algorithm discussed in class. a) b) c) d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
