In your opinion, which common algorithm is the most elegant?
I like heap sort. Only O(log n) tho
>>57033107
how do those last three even work?
>>57033242
The last three do not exist(yet?). Well I guess O(0) can be defined as unused algorithms.
>>57033242
O(0) is done as soon as it's given input, without any computation necessary
O(-1) is done before it's even given input, and would be non-causal
No idea what -O would be
sleep sort
Reproduction
>>57033242
Here is my take on it :
>O(0)
The moment you start the program, the algorithm is already done, before the first bits are even send to your CPU
>O(-1)
Where O(1) would have taken n seconds to run, the algorithm is finished n seconds before you run the program.
>-O
These algorithm are unbound by "When?" or even "Where?". They are running on the fundamental rules of space time, they start and end at any moment.
>>57033321
>O(0) is done as soon as it's given input, without any computation necessary
No that would still be O(1) since it would still return the output in a constant time.
>>57033403
Well yeah, O(0) is still the same complexity class as O(1), just like O(2) would be if it existed
O(-1) is constant time too, it's just constantly negative.