Question: Compute the recurrence for the worst case time complexity and draw the recursion tree for the recursivea lgorithm below: 3 5 Input: A: array of

Compute the recurrence for the worst case time complexity and draw the recursion tree for the recursivea lgorithm below:

Compute the recurrence for the worst case time complexity and draw the

3 5 Input: A: array of n objects Input: B: array of n objects Input: n: number of elements in A and B Output: minimum distance between two points in A and B according to function dist 1 Algorithm: MinDist 2 if n=1 then | return dist(A[1], B[1]); 4 else mid [n/2]; A1 A[1..mid]; A2 A[mid + 1..n]; B1 = B(1..mid]; B2 = B[mid + 1..n]; d11 MinDist(A1, B1); d12 MinDist(A1, B2); d21 MinDist(A2, B1); d22 MinDist(A2, B2); return min{d11, d12, d21, d22}; 15 end 6 7 = 8 9 10 11 12 = 13 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!