A new linear time O(N) sorting algorithm [Keep it secret 🔒]

* Compare two adjacent elements one by one starting from the first element
* If there are out of order, delete the second element and continue with step 1
* If in order, go to the next two elements
* Once done, act like the numbers you deleted never existed

Works all the time.
Not yet published. Thinking of a good name for it.

  • 5
    I'll call it:

    Guess Sort/ Throw Dice Sort Algo: you either get part of sorted result or you get nothing
  • 30
    Yeet Sort
  • 21
    Stalin purges sort
  • 29
    A bonus feature -- it's also a compression algo!
  • 7
    Name suggestions from my beter half: memory-hole or Stalin algorithm
  • 11
    Deletion sort as opposed to insertion sort.
  • 11
    Gulag sort
  • 2
  • 3
    blackhole sort.
  • 8
    @magicMirror That would be deleting the whole list. It would even be in O(1), quite an improvement.
  • 2
    Golias sort, cause you yeet the greatest like David
  • 2
    @Fast-Nop AFAIK - thats the worst (best?) case scenario for this sort. hence the name.
  • 4
    Just gonna leave these here:
    - NotMyProblem-sort
    - YouHadOneJob-sort
    - ItsClearlyQAsFault-sort_v2
    - AreYouSure?-sort
    - DontKnowDontCare-snort
    - WhatNumbers?-v1237
  • 3
    This sorting algorithm is EXTREMELY common.

    You might be surprised. It's what people tend to do when for example in distributed or concurrent systems or something things get consumed out of order.

    Just ignore the thing with the missing dependency.

    It's also an example of eventual consistency so now you know what it means at last, the moment you've been waiting for.
  • 1

    ... They never existed
  • 2
    Preety sure that is Stalin sort. Has been documented before.
  • 1
  • 1
    Let's call it trash sort.
  • 1
    Old joke! booooo!

    Also the tag is wrong! You suck!
  • 2
    @Gregozor2121 Please let that be sarcasm, and if it is, please make it clear. The tag *is* wrong, but when you mix truth and sarcasm, it looks rude. Even if it is an old joke, it's never ok to boo somebody for that unless it's spam, in which case it should be reported as such, and almost never ok to tell somebody they suck unless it's clearly a joke (even then, it's borderline)
  • 2
    We need to raise a petition to rename Stalin-sort to Yeet-sort, the name is just much much better
  • 2
    @sploders101 The whole thing was a joke.
  • 2
    @Gregozor212 Ok, I couldn't tell. Thanks for the clarification lol
  • 3
    @sploders101 And even if, it's completely OK to tell someone when he did stupid shit, and to call him a shithead if he does so repeatedly. Actually, not doing so causes harm in the long run.
  • 2
    @Fast-Nop I can point several examples where it is wrong...
    *Looking at my parents*

    I think the anwser you are looking for is: It fucking depends.
  • 1
    Pop Sorta Algorithm
  • 1
    @netrikas something like middle-out?
Add Comment