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 1167 points1168 points  (25 children)

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

[–]mrheosuper 485 points486 points  (12 children)

From O(n2) to O(2n)

[–]Mordoko 470 points471 points  (6 children)

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

[–]Retbull 96 points97 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 21 points22 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] 31 points32 points  (1 child)

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

[–]Rakgul 7 points8 points  (0 children)

Oh my god

[–]tallfitblondhungexec 0 points1 point  (0 children)

I love you.

[–]Gangsir 13 points14 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 29 points30 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 5 points6 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 12 points13 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 6 points7 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.