Why Java impl choose merge sort over quick sort? and why do they copy the content to an array?
API: “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). This algorithm offers guaranteed n log(n) performance. This implementation dumps the specified list into an array, sorts the array, and iterates over the list resetting each element from the corresponding position in the array. This avoids the n2 log(n) performance that would result from attempting to sort a linked list in place.”
Java guys traded the worst-case scenario with the avg case, as you probably know, quick sort might run in O(n^2) in the worst case..
You can read in the API, sorting a linked list in-place is more complex n^2log(n)
Merge sort is stable which the isn’t true for the efficient version of quicksort.
(which can be highly important upon sorting objects + many programmers take that as granted when they use Collections.sort())