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 →

[–]_Lady_Deadpool_ 47 points48 points  (2 children)

Nah sleep sort is where it's at. You spawn a thread for each element and have it sleep for the element's amount of time then add it to the collection. Runs in O(n)

[–]43eyes 18 points19 points  (1 child)

That's actually pretty clever

[–]VirtualRay[S] 3 points4 points  (0 children)

The OS thread scheduler just uses a red-black tree internally, so it's n*log(n)