ENH: add quickselect algorithm and expose it via partition

A partition sorts the kth element into its sorted order and moves all
smaller elements before the kth element and all larger elements behind it.
The ordering of all elements in the partitions is undefined.

It is implemented via the quickselect algorithm which has average linear
complexity compared to a full sort that has linearithmic complexity.
The worst case is quadratic.

String selection is implemented in terms of quicksort which has the same
properties as a selection for now.
ENH: implement median in terms of partition

partitioning is sufficient to obtain the median and is much faster.