Implement quicksort (in-place) algorithm