Insertion sort
Grow a sorted prefix by inserting each value where it belongs.
Values5, 1, 4, 2, 8, 3
Start with the array 5, 1, 4, 2, 8, 3.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub
Grow a sorted prefix by inserting each value where it belongs.
Values5, 1, 4, 2, 8, 3
Start with the array 5, 1, 4, 2, 8, 3.
Space play · ← → step · Home End jump · drag the strip to scrub