Sorting easy time O(n²) space O(1)
Selection Sort
Scan the unsorted part for the minimum, swap it to the front of that part, and grow a sorted prefix from the left.
Repeatedly pick the smallest of what remains and place it next.
1 / 40
Practice
Machine twin: /dsa-viz-v2/selection-sort.json — the full deterministic run as structured data.