Y
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
shitlord
1716 days ago
Yup, sleep sort:
https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort
link
tylerhou
1716 days ago
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.
link
OldHand2018
1716 days ago
Brilliant!
Although if it took a long time to enumerate the list of elements…
link
ballenf
1715 days ago
Pass them in as milliseconds or nanoseconds?
link