Insertion Sort
Algorithm
For every element in the list, pick the element and place it at its corresponding position, either before or after the previous element.
Performance
Worst case:
comparisons and swaps
Best case:
comparisons,
swaps
Average case:
comparisons and swaps
Space complexity:
total or
auxiliary
Properties
An invariant is that all the items on the left-hand side that have been inserted will remain in-order after every iteration.
Implementations
LSL
ARexx