NOTE
Selection Sort
Repeatedly selecting the minimum/maximum with quadratic comparisons and few swaps.
This is a historical learning note and may contain outdated or incomplete understanding.
Selection sort repeatedly finds the smallest remaining element and swaps it into the next output position.
It performs O(n^2) comparisons regardless of input order but only O(n) swaps. The standard form is in-place and not stable.
It is mainly educational or useful when writes/swaps are unusually expensive and input size is small.