Skip to content
DevMeme
2048 of 7590
CS Fundamentals Post #2282 · source on Telegram

The Utopian Dream of a Linear Time Sort

Description

A two-part meme. The top part has black text on a white background that reads, "The world if Sorting could be done in O(n)". The bottom part is an image depicting a futuristic, utopian city. The city features sleek, curved, glass-and-white buildings, flying vehicles of various designs, elevated monorails, and abundant green spaces with lush lawns and trees. A person is walking a small robotic dog along a waterway in the foreground. This meme format, "The World if X," imagines a vastly improved reality based on a single, often impossibly ideal, change. The technical joke is that the best comparison-based sorting algorithms have a time complexity of O(n log n), making an O(n) sort a holy grail in computer science. Achieving this would represent such a massive leap in computational efficiency that it would, hyperbolically, usher in an era of unprecedented technological advancement and prosperity

Comments

19
Anonymous ★ Top Pick We finally achieved O(n) sorting. Turns out the constant factor is so large that the heat death of the universe is a more pressing performance bottleneck
  1. Anonymous ★ Top Pick

    We finally achieved O(n) sorting. Turns out the constant factor is so large that the heat death of the universe is a more pressing performance bottleneck

  2. Anonymous

    If we ever crack a true O(n) comparison sort, the biggest payoff won’t be flying cars - it’ll be product managers instantly upping the SLA to “real-time for every user event,” and by sprint two we’re back to benchmarking cache lines like it’s 1999

  3. Anonymous

    After 20 years of optimizing database queries and watching junior devs rediscover bubble sort, I've accepted that O(n log n) is our cross to bear - though I still dream of the day someone proves P=NP and we all retire to our flying cars and radix-sorted utopia

  4. Anonymous

    Ah yes, the mythical O(n) comparison-based sort - right up there with P=NP and bug-free legacy code. While radix and counting sort can hit linear time under specific constraints, the information-theoretic lower bound of Ω(n log n) for comparison sorts is as immutable as a const reference in C++. But imagine: if we could break that bound, we'd probably also have solved the halting problem, achieved perfect cache locality, and convinced management that technical debt actually matters. Until then, we'll keep quicksorting our way through this dystopia, one pivot at a time

  5. Anonymous

    Even if someone beat the comparison‑model Omega(n log n), the flame graph would just move to “S3 read” while PMs ask for a stable, locale‑aware multi‑key sort anyway

  6. Anonymous

    Utopia if sorting were O(n); in reality our “linear” sort assumes 32‑bit keys, stable radix, and infinite RAM - then i18n asks for locale collation and the monorail snaps back to n log n

  7. Anonymous

    O(n) sorting: the singularity where CS profs retire, but we'd still debate stable vs unstable over coffee

  8. Deleted Account 5y

    Radix has entered the chat

    1. @RiedleroD 5y

      beat me to it

  9. @RiedleroD 5y

    also counting sort

    1. Deleted Account 5y

      Not that functional

      1. @RiedleroD 5y

        no but technically O(n)

        1. @saidov 5y

          Technically bogosort’s best case is O(1)

          1. @RiedleroD 5y

            I like your style. Have you ever heard of Intelligent Creation Sort?

            1. @saidov 5y

              No

              1. @RiedleroD 5y

                https://www.dangermouse.net/esoteric/intelligentdesignsort.html

          2. @wizaral 5y

            O(1) for every sorting. O(n) for bogo)

            1. @saidov 5y

              Oops you’re right

  10. @RiedleroD 5y

    also bucket sort, but that one's nuts

Use J and K for navigation