Function core::slice::sort::partition

source ·
pub(super) fn partition<T, F>(
    v: &mut [T],
    pivot: usize,
    is_less: &mut F
) -> (usize, bool)where
    F: FnMut(&T, &T) -> bool,
🔬This is a nightly-only experimental API. (slice_internals)
Expand description

Partitions v into elements smaller than v[pivot], followed by elements greater than or equal to v[pivot].

Returns a tuple of:

  1. Number of elements smaller than v[pivot].
  2. True if v was already partitioned.