4 ms·
Another similar "algorithm": sleep sort. Basically, take a list of integers, and for each element n create a thread that sleeps n seconds, after which it appen
by tomp 12y ago
Another similar "algorithm": sleep sort.
Basically, take a list of integers, and for each element n create a thread that sleeps n seconds, after which it appends n to the result list.
Assuming the original list is dense (there are no gaps between integers), we can sort it in O(n)!
:)