Suppose we call MergeSort on the following array from main I

Suppose we call MergeSort() on the following array from main(). In total, how many recursive calls to MergeSort() will be made before the function returns to main()? (Do not count the initial call to MergeSort() from the main() function. Only count the total number of recursive calls made after that initial call.) Assume we are using the implementation coded up in class.

Solution

in total there will be 6 recurrisons for this array if we implement merge sort.

At last the resultant array will be off

13 29 50 82 80 80

here the first 80 in the resulatant array is the elemnt in the 0th index in the figure given abve

 Suppose we call MergeSort() on the following array from main(). In total, how many recursive calls to MergeSort() will be made before the function returns to m

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site