Skip to main content
Log in

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?