quicksort 3 way partitioning