quicksort: median of 3