help with these two Java questions, To understand how the merge sort algorithm sorts a list. In
Question:
help with these two Java questions,
To understand how the merge sort algorithm sorts a list. In the notes for Sorting Algorithms: Section 7 : Merge Sort Example it was traced how merge sort would recursively sort list = { 4, 2, 7, 3, 5, 13, 11, 8, 6, 2 }. For this exercise, draw a similar diagram showing how merge sort would sort list = { 5, 3, 1, 6, 2, 4 }.
In Sorting Algorithms : Section 9 : Merge Sort Pseudocode were discussed the high-level pseudocode for the merge sort algorithm. There are three methods: recursiveMergeSort(), merge(), and copyRest(). Continuing the previous exercise, how many times will recursiveMergeSort() be called when sorting the list of Exercise 3.1. Include the original non recursive call to recursiveMergeSort() and all of the subsequent recursive calls in the answer.
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest