4 ms·
This is a slightly simpler (because of unicity) version of bucket sort or counting sort.
by catwell 5y ago
This is a slightly simpler (because of unicity) version of bucket sort or counting sort.
- sli 5y agoI remember seeing a (gag) variation of counting sort that just provided each element as an argument to `sleep`.
- tylerhou 5y agoThat’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.
- OldHand2018 5y agoBrilliant! Although if it took a long time to enumerate the list of elements…
- ballenf 5y agoPass them in as milliseconds or nanoseconds?
- shitlord 5y agoYup, sleep sort: https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort