Java 6\'s mergesort implementation in Arrays.java uses an insertion-sort if the array length is less than some threshold. This value is hard-coded to 7. As th
Insertion sort is n(n-1)/2 and merge sort is n*(log n with base 2 ).
Considering this -
From above data it is clear, till length 6, insetion sort is faster and after 7, merge sort is efficient.
That explains why 7 is used.