- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
You must log in or register to comment.
Race condition
finally, sorting in linear time /s
I’m dumb, can someone ELI5 please?
The output is sorted due to the fact that for each number, a timer is started that prints out the number after waiting a number of milliseconds equal to said number.
Therefore, 1 is printed first after delaying for 1 millisecond, 5 is printed second after 5 milliseconds etc.



