In: Computer Science
Sorting (merge)
Sort the array (as in Part 2) using merge sort. Write the
array content...
Sorting (merge)
Sort the array (as in Part 2) using merge sort. Write the
array content after each pass (i.e., from pass 1 to pass 9). Each
pass is defined as the completion of one merge
operation.
Suppose an array contains the following integers: -1, 20, 10, -5,
0, -7, 100, -7, 30, -10. Sort the array using the following
algorithms: selection sort, bubble sort, and insertion sort. For
each algorithm, write the array content after each pass (i.e., from
pass 1 to pass 9). Each pass is defined as one iteration of the
outer loop. There are total of n − 1 passes, where n is the array
size.