partition operation for quicksort