10
Sleep Sort (www.aprogrammerlife.com)
submitted 1 year ago by [email protected] to c/[email protected]

Time complexity isn't even associated to the size of the list. Amazing!

top 4 comments
sorted by: hot top new old
[-] [email protected] 4 points 1 year ago

This should be taught in computer classes, as an illustration that O(1) does not necessarily mean "fastest".

[-] [email protected] 1 points 1 year ago

It's not O(1) though. There is still a normal sorting algorithm sorting this list, it's just inside the OS scheduler.

[-] [email protected] 2 points 1 year ago

I didn't mean to imply that it was; I was referring to countless developers I've worked with over the years who thought hash maps were the fastest memory storage structure because they are generally O(1); they've mostly been ignorant of the fact that it's only true for sufficiently small values of "1".

[-] [email protected] 1 points 1 year ago

the environment or operating system will ultimately have to use a sorting algorithm with a normal time complexity to determine the order of events (or it can give up and sort them incorrectly once the time resolution is not high enough)

this post was submitted on 10 Jul 2024
10 points (81.2% liked)

VS Code

978 readers
1 users here now

founded 2 years ago
MODERATORS