Selection Sort works by repeatedly finding the minimum element from the unsorted portion and putting it at the beginning.
Time: O(n²) always (even if sorted). Space: O(1). It makes the minimum number of swaps (at most n-1), which can be useful in some cases.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
selection_sort([64, 25, 12, 22, 11])
[11, 12, 22, 25, 64]