Question: Problem 8 (10 points). Execute mergeSort on the given vector A of integers. For each recursive call, shows, e, m and the content of A

 Problem 8 (10 points). Execute mergeSort on the given vector A

Problem 8 (10 points). Execute mergeSort on the given vector A of integers. For each recursive call, shows, e, m and the content of A at the end of the recursive call. 1 evoid merge Sort (vector &A, int s, int e) { if(s == e) 3 return; 4 int m = (s + e)/2; 5 mergeSort (A, s, m); 6 merge Sort (A, m+l, e); 7 merge (A, s, m, e);//merges sorted ranges As,m] and A[m+1,e] 8 } WN A before merge Sort(A, 0, 7) 16|1| 12 | 30 | 25 | 12 | 20 | 9 e- m= es m= S= e= m= 5 6 0 5 1 4 2 6 2 S e- m= S= es m= S= e- m= S= 11 m= 4 5 5 s= e= S= e- S= S= e- s= es e- S= e- S s= e- S= e=

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!