Module quicksort
This module contains an unstable quicksort and two partition implementations.
Structs
- GapGuard
-
GapGuardRaw
Ideally this wouldn't be needed and we could just use the regular GapGuard.
See comment in
partition_lomuto_branchless_cyclic. - PartitionState
Functions
- inst_partition
-
partition
Takes the input slice
vand re-arranges elements such that when the call returns normally all elements that compare true foris_less(elem, pivot)wherepivot == v[pivot_pos]are on the left side ofvfollowed by the other elements, notionally considered greater or equal topivot. -
partition_hoare_branchy_cyclic
See
partition. - partition_lomuto_branchless_cyclic
-
quicksort
Sorts
vrecursively.