Implemented quicksort with abstract pivot selection method