Question: The pseudo code for Merge has been included. This is one question with multiple parts. MERGE(A, p.q.r) 2 n2 = r-q 3 let L.n and
The pseudo code for Merge has been included.
This is one question with multiple parts.
MERGE(A, p.q.r) 2 n2 = r-q 3 let L.n and R[1..n2 +1] be new arrays 4 fori toi [i] = A[p + i-1) 6 forj1 to n2 10 i=1 12 for k -p to r 13 if LiRU 14 15 16 A[k] = L[i] i=i+1 else A[k] = R[j] 17 MERGE(A, p.q.r) 2 n2 = r-q 3 let L.n and R[1..n2 +1] be new arrays 4 fori toi [i] = A[p + i-1) 6 forj1 to n2 10 i=1 12 for k -p to r 13 if LiRU 14 15 16 A[k] = L[i] i=i+1 else A[k] = R[j] 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
