Suppose the following arrays have been declared:
int[] numbers1 = {63, 9, 45, 72, 27, 18, 54, 36};
int[] numbers2 = {37, 29, 19, 48, 23, 55, 74, 12};
int[] numbers3 = {8, 5, –9, 14, 0, –1, –7, 3};
int[] numbers4 = {15, 56, 24, 5, 39, –4, 27, 10};
a. Write the state of the elements of each array after each pass of the outermost loop of the selection sort algorithm has occurred (after each element is selected and moved into place).
b. Trace the complete execution of the merge sort algorithm when called on each array. Show the subarrays that are created by the algorithm and show the merging of subarrays into larger sorted arrays.
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.