🔬This is a nightly-only experimental API. (
slice_internals)Expand description
Slice sorting
This module contains a sorting algorithm based on Orson Peters’ pattern-defeating quicksort, published at: https://github.com/orlp/pdqsort
Unstable sorting is compatible with core because it doesn’t allocate memory, unlike our stable sorting implementation.
In addition it also contains the core logic of the stable sort used by slice::sort based on
TimSort.
Structs§
- TimSortRunExperimentalInternal type used by merge_sort.
Functions§
- heapsortExperimentalSorts
vusing heapsort, which guarantees O(n * log(n)) worst-case. - merge_sortExperimentalThis merge sort borrows some (but not all) ideas from TimSort, which used to be described in detail here. However Python has switched to a Powersort based implementation.
- quicksortExperimentalSorts
vusing pattern-defeating quicksort, which is O(n * log(n)) worst-case.