Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
The array to partially sort (in place).
The middle index for partial sorting.
Optional
The left index of the range to sort.
The right index.
The compare function.
Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].