Question: Determine what the algorithm does, set up the recurrence relation and solve it to obtain its computational complexity. ALGORITHM Q(A[L..r]) if L== r return A[L]
Determine what the algorithm does, set up the recurrence relation and solve it to obtain its computational complexity.
ALGORITHM Q(A[L..r])
if L== r return A[L]
else temp1 = Q(A[L..floor((L + r)/2)]
temp2 = Q(A[floor((L + r)/2) + 1..r]
if temp1 <= temp2 return temp1
else return temp2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
