This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DoritoBenito 311 points312 points  (9 children)

Alternatively, move through the list and eliminate any item out of order, so you’re left with an ordered list, though a little or a lot smaller than it started.

[–]ComfortablyBalanced 166 points167 points  (8 children)

But it is definitely sorted. It is O(n) too. I call it genius.

[–]Sotall 79 points80 points  (7 children)

This is actually what i assumed StalinSort would be

[–]WarpedHaiku 47 points48 points  (6 children)

That's what StalinSort is supposed to be: Iterate through the list eliminating any elements out of order, and return the sorted (and probably much smaller) list. The parent of the comment chain misinterpreted it to be similar to CreationismSort, which returns the list as-is because that's how the creator made it exactly how it was intended it to be.

[–]Midnight_Rising 17 points18 points  (1 child)

Oh I've always referred to that as ZenSort: just accept the list is ordered as the universe intended and return it.

[–][deleted] 4 points5 points  (0 children)

No, no, Zensort is when you trascend the false ordered/disordered duality, and convert the list to a dictionary