Skip to main content

function

insertion_sort

insertion_sort[type: ComparableCollectionElement](inout list: List[type])

Sort list of the order comparable elements in-place with insertion sort algorithm.

Parameters:

  • type (ComparableCollectionElement): The order comparable collection element type.

Args:

  • list (List[type]): The list of the order comparable elements which will be sorted in-place.

Was this page helpful?