title: Why does java.util.Arrays.sort(Object[]) use 2 kinds of sorting algorithms?
body: <p>I found that <code>java.util.Arrays.sort(Object[])</code> use 2 kinds of sorting algorithms(in JDK 1.6).</p>
  
  <p>pseudocode:</p>
  
  <pre><code>if(array.length&lt;7)
     insertionSort(array);
  else
     mergeSort(array);
  </code></pre>
  
  <p>Why does it need 2 kinds of sorting here? for efficiency?</p>