Quicksort with median-of three partitioning and cutoff to insertionsort