DEV Community

loading...

Discussion on: Sleep Sort: Where Theory meets Sobering Reality

Collapse
ghost profile image
Ghost

It feels like this would not always sort correctly if you account for processing time.

Example. If the list has 1 million items and the first is 0.2 and the last is 0.1. The processing time may be larger than the sleep time of the first item meaning the last item would be out of order. This is slightly different to the failure cases written above.