Documentation

Init.Data.Array.InsertionSort

@[inline]
def Array.insertionSort {α : Type u_1} (xs : Array α) (lt : ααBool := by exact (· < ·)) :

Sorts an array using insertion sort.

The optional parameter lt specifies an ordering predicate. It defaults to LT.lt, which must be decidable to be used for sorting.

Equations
@[specialize #[]]
def Array.insertionSort.traverse {α : Type u_1} (lt : ααBool := by exact (· < ·)) (xs : Array α) (i fuel : Nat) :
Equations
@[specialize #[]]
def Array.insertionSort.swapLoop {α : Type u_1} (lt : ααBool := by exact (· < ·)) (xs : Array α) (j : Nat) (h : j < xs.size) :
Equations