Loading...
Loading...
Discrete Math · Axiom Academy
Watch sorting algorithms compete head-to-head! Discover why some algorithms dominate as data grows larger. Let's watch two different sorting algorithms race to organize a small list of numbers. Click "Start Race" to see them compete! Now let's double the data size. Will both algorithms still perform similarly? The Dramatic Difference: Large Dataset Let's see what happens with a truly large dataset. This is where algorithm choice really matters! Let's compare the race times across all three dataset sizes to see the pattern clearly. Why Algorithm Analysis Matters Algorithm efficiency isn't about constant factors—it's about how performance scales with data size. A quadratic algorithm (O(n²)) becomes impractical with large datasets, while O(n log n) algorithms remain usable even with millions of items. Bubble Sort (O(n²)): 100× more data → 10,000× slower Merge Sort (O(n log n)): 100× more data → only ~664× slower This gap only widens as n grows! Google processes billions of searches. Social media sorts millions of posts. Databases query terabytes. Without efficient algorithms (O(n log n) or better), these systems would be impossibly slow. Algorithm choice is the difference between instant and infinite. What you witnessed is called asymptotic analysis —studying how algorithms behave as input size approaches infinity. Big O notation (O(n²), O(n log n)) formalizes this, letting us compare algorithms mathematically before writing a single line of code.
This is the written version of the interactive lesson above. See the full Discrete Math course.