Return indices that would partition the array. The k-th element of
the result is the index of the k-th smallest element; elements
before index kth are indices of smaller-or-equal elements, and
elements after are indices of greater-or-equal.
Partial sort: rearrange elements so that a[kth] is the value that
would be there in a sorted array, all elements before it are <=,
and all elements after are >=. The relative order within the two
halves is undefined.