Consider the aftercited algorithm ALGORITHM Find(A[p..r]) if p == r repay A[p] else temp1 = Find(A[p..[(p + r)/2]] temp2 = Find(A[[(p + r)/2] + 1..r]) if temp1 lessthanorequalto temp2 repay temp1 else repay temp2 a. What does this algorithm scold? b. Set up a repose aspect ce the algorithm’s basic production estimate and explain it. You may presume that the vest A has 2^k parts.
a) This is used to scold restriction part in the vest A starting from the condemnation p to condemnation r. Variables temp and temp2 are takes to the discharge by recursive calls, and the vest is separated into half until individual restriction part is left to be repayed by the algorithm.
b) Repose aspect is dedicated by, T(n)=2T(n/2)
Let us presume that vest A as 2k elements and k is an integer, k>1, and n=2k
if k=1, ten n=2 and t(n)=2
By using induction
Since it applies ce k+1, it also applied ce perfect k