为什么Arrays.sort是快速排序算法,为什么不是其他的排序算法?

为什么Arrays.sort是快速排序算法,为什么不是其他的排序算法?

问题描述:

为什么呢?它是更快或者更effiecent?

Why? Is it faster or more effiecent?

对于1个核心,我们可以使用快速排序。我们应该在一个系统中使用带有2个内核,4核,8核是什么?

For 1 core, we can use quicksort. What should we use on a systems with 2 cores, 4 cores, 8 cores?

快速排序为O(N log n)的平均水平,为O(n ^ 2)最坏情况下的性能,这是最好的一般情况排序算法可以,存在具有这种性能的其他排序算法,但快速排序趋于执行优于大多数

Quicksort has O(n log n) average and O(n^2) worst case performance, that is the best "average case" a sort algorithm can be, there are other sort algorithms that have this performance, but quicksort tends to perform better than most.

请参阅: http://en.wikipedia.org/wiki/Quicksort