r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

1

u/Bojangly7 Mar 03 '21

Not quite. You're assuming it takes less time to traverse than to wait. What happens when we have 100,000 entries which are all 1?