1. Engineering
  2. Computer Science
  3. please explain in detail and fill in the table i...

Question: please explain in detail and fill in the table i...

Question details

Use the following pseudocode for the merge phase of Mergesort on the following problems Assume arrays begin with index 0, and lines such as for i - a to b terminate when 〉 b. so it is equivalent to for (i = a; i 〈= b; 1++) 1. procedure merge(A: an array of integers, integers lo, mid, hi) 3. initialize array B[lo..hi] :- A[lo..hi] 10, J := mid + 1 4. for k-lo to hi if i 〉 mid then A[k] := B[j++) else if j > hi then A[k] B[it+] else if B[j] < B[i] then A[k] : Blj++] else A[k] :- B[i+] printf ( i : %d j: %d k: %d B[i]: %d bij] : %d, i, j, for r -lo to hi 8 10 printf( A[%d] : %d, r, A[r]) (a) 25 pts Fill out the following table for values printed by the pseudocode for merge with A [4,7,-6,-3,-4,8], lo 0, mid 1 and hi-2. If an index causes an invalid access (out of bounds or garbage value), denote this with an X AII A[2Please explain in detail and fill in the table. I want to know how to solve. Thanks

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution