Skip to main content

module

sort

Implements the built-in sort function.

These are Mojo built-ins, so you don't need to import them.

Functions

  • partition: Partition the input vector 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 vector inplace. The function doesn't return anything, the vector is updated inplace.
  • insertion_sort: Sort list of the order comparable elements in-place with insertion sort algorithm.
  • quick_sort: Sort list of the order comparable elements in-place with quick sort algorithm.