Can anyone explain me this sentence please?
The sorting algorithm is a modified
mergesort (in which the merge is
omitted if the highest element in the
low sublist is less than the lowest
element in the high sublist).
Link: Arrays.sort(Object[] arr)
I know how Merge works, but I still don’t understand well.
Thank you.
Mergesort recursively merges sorted sublists. If the current sublists eligible for merging contain no overlapping elements, there’s no need to merge them. The merge operation would be skipped.
Example:
There’s no need to go through the process of comparing these lists because 9 is the largest element of A and 10 (the first element of B) is larger than the largest element of A. The result would just be the concatenation of A and B.
All the document is saying is that they take a shortcut if comprehensive processing is unnecessary.