title: Why does Java's Arrays.sort method use two different sorting algorithms for different types?
body: <p>Java 6's <code>Arrays.sort</code> method uses Quicksort for arrays of primitives and merge sort for arrays of objects. I believe that most of time Quicksort is faster than merge sort and costs less memory. My experiments support that, although both algorithms are O(n log(n)). So why are different algorithms used for different types?</p>