Post

One can easily optimize it for not too big N. sleep(1e66 - (time() - startTime) will give us a constant complexity until n became too big. However, one may just increase that scalability constant and get C again.

Well, I'd like to make it as clean as possible. If they have the cosmological constant in physics, why don't have a scalability constant in computer science? It will simplify everything.

*dull mode on* No, it doesn't. As stated in comments above the time complexity of the sleepsort depends not on the quantity of the elements in input data, but on elements' values. Taking the O for the sleep(n) itself as O(n) we get the n=MAXn(Vi) for the best case (enough CPUs) and ...

I haven't looked at what sleepsort is, but if it's linear then that shouldn't matter. if you're comparing two algorithms and they're the same O(n) time complexity, one is either always faster or always slower.

The less-than-fun f̶a̶c̶t̶ bit: one might actually need this, in cryptography, against some attacks. But it won't be this simple.

even the best sorting algorithms always scales non-linearly — if it takes n units of time to sort n items, it will always take more than n+1 units of time to sort n+1 items. here, youre cheating it by just adding more sleep time to make it scale linearly

> Even the best sortin algorithms scale non-linearly Well not quite, there are natural sorting algorithm like Gravity Sort which would sort in linear time (though in practice a naive implementation is quadratic on a computer)