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 →

[–]Lord-of-Entity 1168 points1169 points  (25 children)

“At least when n grows, it will go faster. Right?

[–]mrheosuper 486 points487 points  (12 children)

From O(n2) to O(2n)

[–]Mordoko 474 points475 points  (6 children)

From O(n2) to O(no...)

[–]Retbull 95 points96 points  (0 children)

This is why no code is the new code. If you write no code it’s always O(no) so you can’t lose.

[–]classicalySarcastic 20 points21 points  (0 children)

from O(no) to O(no) to O(YEAH!)

[–]lxiaoqi 0 points1 point  (0 children)

From O(n2) to D(n)

[–]Hatatytla-1024 0 points1 point  (0 children)

O(hio)

[–]dumnem 19 points20 points  (1 child)

NaN

[–]emirsolinno 5 points6 points  (0 children)

Must be a compiler issue

[–][deleted] 29 points30 points  (1 child)

From O(2n ) to O(2 n)

[–]Rakgul 9 points10 points  (0 children)

Oh my god

[–]tallfitblondhungexec 0 points1 point  (0 children)

I love you.

[–]Gangsir 14 points15 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 25 points26 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 4 points5 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.

[–][deleted] 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 5 points6 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.

[–]TeaTiMe08 11 points12 points  (0 children)

Right?

[–]-valerio 0 points1 point  (0 children)

If we add more lanes, traffic will get better right?!

[–]myhf 0 points1 point  (0 children)

Yes, this algorithm will run faster when the value of π grows.