Putting things in order is one of the first things any computer does. Your contacts, your photos by date, search results by relevance — under all of it sits a sort. It feels like a solved, boring problem.
But here is a strange question: how fast can sorting possibly be? Clever people have invented dozens of sorting algorithms. Could someone, tomorrow, invent one so clever it sorts a million items in a few hundred steps?
For any algorithm that works by comparing pairs of items — "is A before B?" — the answer is a flat no. There is a wall at roughly n log n comparisons, and no amount of cleverness gets you past it. The remarkable part is that we don't just believe this — we can prove it, by counting.
Comments
Loading comments...