AlgoBazaAlgoBaza
Back to algorithms

Selection Sort

In every pass it selects the smallest element of the unsorted part and puts it in the next position. It makes at most n - 1 swaps.

Podstawowy
O(n^2)O(1)BOBRALEMOZGIINSTALOGIK

๐Ÿ”Ž Selection Sort โ€” Games

Play both games to master the algorithm!

๐Ÿ’ก

Tip: Start with Game 1 โ€” you'll learn to predict where the minimum goes and how many swaps there will be. In Game 2 you run every step of the algorithm yourself, exactly like tracing code on paper in a contest.