Hacker News new | ask | show | jobs
by sli 1716 days ago
I remember seeing a (gag) variation of counting sort that just provided each element as an argument to `sleep`.
3 comments

That’s more like heapsort, because the OS will use a heap to implement a priority queue that contains times for when the next process needs to be scheduled.
Brilliant!

Although if it took a long time to enumerate the list of elements…

Pass them in as milliseconds or nanoseconds?