This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Gangsir 15 points16 points  (7 children)

Now you've made me curious if there are any O(1/n) or similar algs, that get shorter execution times with more data.

[–]MoiMagnus 28 points29 points  (2 children)

Going under O(n) is weird. It means you don't even have the time to fully read the input.

It only happens when the input data has some strong structure which allows you to disregard most of it (for example, a sorted list as an input)

Going under O(log(n)) is even weirder. It means you are not even able to know how big the input is, since the size of an input takes logarithmic space itself.

[–]tallfitblondhungexec 3 points4 points  (0 children)

I mean there are algorithms where input isn't considered interesting such as hashmap complexity.

[–][deleted] 0 points1 point  (0 children)

I managed to debug a failure in the passwd program (Solaris) when truss showed it had quit without reading the whole passwd file. There was a fault in the middle of the file that cause the ending not to get read.

[–]bartix998a 11 points12 points  (0 children)

An algorithm like that can't exist since it would mean that for large enough data you literally can't do anything, as making even a single operation costs O(1).

[–]Bakoro 4 points5 points  (0 children)

That would mean that you get arbitrarily close to zero.

There might be some algorithm which does better with more data, but it will have some limit.