July 2018
Beginner
202 pages
5h 4m
English
We need to complete the pseudocode for a merge sort algorithm.
Keeping in mind that the merge sort's recursive part is very similar to the quick sort algorithm we saw in the preceding section, complete the pseudocode shown in the following code as follows:
mergeSort(array, start, end) if(_____________) midPoint = _________ mergeSort(array, _____, _____) mergeSort(array, _____, _____) merge(array, start, midPoint, end)
The pseudocode for merge sort can be completed as follows:
mergeSort(array, start, end) if(start < end) midPoint = (end - start) / 2 + start mergeSort(array, start, midPoint) mergeSort(array, midPoint + 1, start) merge(array, start, midPoint, end) ...Read now
Unlock full access