Press Play or Step to sort the bars
Big-O describes how the work grows as the input size n grows.
Bubble sort makes up to n(n − 1)/2 comparisons. For n = 1000 that is about 500 000, while n log₂ n is about 10 000.
Hand out numbered cards and let groups sort them by hand using one algorithm each. Count comparisons on the board, then check them against the simulation.
Link to Class 11 and 12 Computer Science: write each algorithm in Python after watching it.
A free coding & ai simulation for Class 9–12 and Olympiad.