Function core::slice::sort::partition_in_blocks
source · fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usizewhere
F: FnMut(&T, &T) -> bool,
🔬This is a nightly-only experimental API. (
slice_internals
)Expand description
Partitions v
into elements smaller than pivot
, followed by elements greater than or equal
to pivot
.
Returns the number of elements smaller than pivot
.
Partitioning is performed block-by-block in order to minimize the cost of branching operations. This idea is presented in the BlockQuicksort paper.