Computer scientists describe how fast an algorithm is with Big-O notation: O(log n), O(n), O(n log n), O(n²). Behind the letters is a simple question: when the input gets twice as big, what happens to the work? Here four real algorithms run on lists of up to 4,096 random numbers while their steps are counted, so you can see the answer for yourself, and why a better algorithm beats a faster computer.

This article and its interactive demo were created with the help of generative AI and editorially reviewed.