Back to algorithmsPodstawowy
Bubble Sort
Compares neighbouring elements and swaps them when they are in the wrong order. After every pass the largest element "floats" to the end ā like a bubble.
O(n^2)O(1)BOBRALEMOZGIINSTALOGIK
š«§ Bubble Sort ā Games
Play both games to master the algorithm!
š”
Tip: Start with Game 1 ā you'll learn to predict what one pass does. In Game 2 you run every step of the algorithm yourself, exactly like tracing code on paper in a contest.