← CS 302 Home

Insertion Sort — Shift & Insert

Save the next unsorted item. Shift sorted items right until the correct position is found. Insert into the gap.
Sorted region grows from left to right. Uses shifts, not swaps.

Sorted
Unsorted
Held / Inserted
Shifted right
Gap