Quicksort using mean pivot and insertion sort