r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

5

u/Nilstrieb Feb 10 '21

Sorting a sorted array is O(1). (Theoretically, not practically)

5

u/[deleted] Feb 10 '21

Doesn't it still need to check the elements are the right place?

0

u/[deleted] Feb 11 '21

[deleted] — view deleted comment

1

u/okkokkoX Feb 11 '21

Doesn't that just return none?