Quicksort with pivot around last element: returns number of comparisons