Question: c++ 8. Following code fragment is an optimized implementation of mergesort, answer following two questions: (1) What is the strategy of Mergesort and how to

c++
c++ 8. Following code fragment is an optimized implementation of mergesort, answer

8. Following code fragment is an optimized implementation of mergesort, answer following two questions: (1) What is the strategy of Mergesort and how to analyze its time complexity?(7 pts) (2) What does the function inssort() in the red rectangle refer to? Write out the detailed implementation of inssort(). (8 pts) template void mergesort (E ALL. E temp 1. int left. int right) { if ((right-left) (GA[left), right-left+1); return; int i, j, k, mid = (left+right) 72; mergesort (A, temp, left, mid); mergesort (A, temp, mid+1, right); // Do the merge operation. First, copy 2 halves to temp. for (i=mid; i>=left; i--) temp[i] = A[i]; for (j=1; j

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!