Interpreter
// Insertion Sort insertionSort := (arr) { n := arr.size i := 1 while i < n { current := arr[i] j := i - 1 while j > -1 & current < arr[j] { arr[j + 1] := arr[j] j := j - 1 } arr[j + 1] := current i := i + 1 } arr } insertionSort([8,5,6,3,2,1,7,9,4])
Run it