custom choosePivot function
custom choosePivot function to quicksort
pivot first