×

Insertion sort

Sorting algorithm
Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time by comparisons. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort. Wikipedia
Best complexity: n
Worst-case complexity: n^2
Stable: Yes
Average performance: comparisons and swaps
Class: Sorting algorithm
Data structure: Array