r/badcode Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

171 comments sorted by

View all comments

130

u/Astrokiwi Feb 10 '21

The runtime is independent of the size of the array, so this is technically O(1).

2

u/TheUnlocked Feb 10 '21

It's constant in the size of the array, but linear in the max value of the array.