Sorting easy time O(n²) space O(1)
Insertion Sort
Keep the left part sorted. Take the next value and slide it left past everything larger, until it sits in the right spot.
The first element is a sorted prefix of one. Extend it, one value at a time.
1 / 35
Practice
Machine twin: /dsa-viz-v2/insertion-sort.json — the full deterministic run as structured data.