π¬This is a nightly-only experimental API. (
slice_internals)Expand description
This module contains the logic for pivot selection.
Re-exportsΒ§
use crate::hint;πuse crate::intrinsics;πExperimental
ConstantsΒ§
- PSEUDO_
MEDIAN_ πREC_ THRESHOLD Experimental
FunctionsΒ§
- choose_
pivot Experimental - Selects a pivot from
v. Algorithm taken from glidesort by Orson Peters. - median3 π
Experimental - Calculates the median of 3 elements.
- median3_
rec π βExperimental - Calculates an approximate median of 3 elements from sections a, b, c, or recursively from an approximation of each, if theyβre large enough. By dividing the size of each section by 8 when recursing we have logarithmic recursion depth and overall sample from f(n) = 3*f(n/8) -> f(n) = O(n^(log(3)/log(8))) ~= O(n^0.528) elements.