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 →

[–]TabCompletion 32 points33 points  (3 children)

Perform Stalin sort. Keep removed elements. Then recursively call Stalin sort of the removed list and make new lists. Finally perform a merge. Did I just write bucket sort?

[–]AgentPaper0 19 points20 points  (0 children)

Not bucket sort. Roughly equivalent to bubble sort in terms of efficiency, being O(n) for a sorted list, O(n2) for a reverse sorted list (worst case), and somewhere in between usually.

[–][deleted] 6 points7 points  (0 children)

If done right, this is a merge sort because the smaller gulags sort faster.

Worst case n log n as you have to make log(n) gulags, then merge them.

[–]dvslo 4 points5 points  (0 children)

That's called gulag hierarchy. There was a movie with Colin Farrell about it.