Back to algorithmsPodstawowy
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.
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.