Question: Your lecturer is a funny guy; given a sorted list of numbers, he will use the following recursive search algorithm to search the smallest number:

Your lecturer is a funny guy; given a sorted list of numbers, he will use the following recursive search algorithm to search the smallest number: static int mininum (L, left, right) if (left == right) then return L[left] else temp1 + minimum(L, left,(left + right)/2) temp2 + minimum(L, (left + right)/2) + 1, right) if tempi s temp2 return tempi else return temp2 (a) Analyse the worst-case asymptotic complexity of the algorithm your lecturer uses. Give the worst-case running time in terms of o notation. Explain your answer. (b) How does this algorithm compare to the algorithm that simply linearly iterates through the list to look for the target? Explain your answer. (Hint: Tricky, do not get mis-led by the question.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
