#selection-sort
Selection Sort
Introduction Selection Sort works by repeatedly finding the minimum element from the unsorted portion and placing it at the beginning. It’s like sorting a hand of cards by scanning for the smallest card each time and moving it to the front. Selection Sort is simple to understand and implement, but it’s always O(n²) — even on sorted input. It makes the minimum number of swaps (at most n-1), which can matter when writes are expensive. Read more →
March 31, 2026