Implement in-place quicksort