Sorted
Key (inserting)
Shifting
Unsorted

Controls

Best: O(n) | Avg: O(n²) | Worst: O(n²) | Stable

Steps

0 steps

Press Run to trace the algorithm one step at a time.