Hi,
I took a look at the partitioning function description. While this quickselect problem probably needs to sort items decreasingly in order for the pivot of the kth largest element to be at position k-1, the description (at least, but maybe the code too) of the partitioning function is the one of the quicksort problem.
In quicksort you are interested to separate items smaller than the pivot to the left of the pivot and the items larger than the pivot to the right of the pivot. Consequently, this partitioning would solve the problem of the kth smallest item.
Please correct me if I’m in error.