Function partial_sort
pub fn partial_sort<T, F, R>(v: &mut [T], range: R, is_less: F)
where
F: FnMut(&T, &T) -> bool,
R: RangeBounds<usize>,
Unstable partial sort the range start..end, after which it's guaranteed that:
- Every element in
v[..start]is smaller than or equal to - Every element in
v[start..end], which is sorted, and smaller than or equal to - Every element in
v[end..].