Hacker News new | ask | show | jobs
by CanSpice 3403 days ago
O() doesn't say anything about how long it'll take. O(n) may never return in your lifetime too.
3 comments

O(1) might not either :)
Because you might be dead already. Which would be a weird edge case.
No. O(1) just means the algorithm always takes no more than some arbitrary, but fixed amount of time to complete, regardless of the size of the input. That fixed amount of time could be a billion years (or more).
It consistently takes a billion years, it's O(1).
That's true, but the odds are way lower.
O(0) would though, right?
You mean O(1) (alternatively, O(k)) -- from the definition of Big O notation, O(0) is nonsensical. But even then; O(1) just means "constant time", it does not mean "soon."
> from the definition of Big O notation, O(0) is nonsensical

Nitpick: not sure it's nonsensical. Plug g(x) = 0 into the usual definition, and you get |f(x)| ≤ k⋅0 for some k in R, which reduces to f(x) = 0. Which is not satisfiable by any nontrivial algorithm, so not very useful, but not nonsensical.