Mojo module
sort
Implements the built-in sort
function.
These are Mojo built-ins, so you don't need to import them.
Aliasesβ
- β
insertion_sort_threshold = 32
:
Functionsβ
- β
merge
: Merge span1 and span2 into result using the given cmp_fn. The function will crash if result is not large enough to hold both span1 and span2. - β
partition
: Partition the input buffer inplace such that first k elements are the largest (or smallest if cmp_fn is < operator) elements. The ordering of the first k elements is undefined. - β
sort
: Sort the list inplace. The function doesn't return anything, the list is updated inplace.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?