5 ms·
O() doesn't say anything about how long it'll take. O(n) may never return in your lifetime too.
by CanSpice 10y ago
O() doesn't say anything about how long it'll take. O(n) may never return in your lifetime too.
- hamandcheese 10y agoO(1) might not either :)
- dr_win 10y agoBecause you might be dead already. Which would be a weird edge case.
- pmiller2 10y agoNo. 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).
- astrodust 10y agoIt consistently takes a billion years, it's O(1).
- chrisdevereux 10y agoO(0) would though, right?
- lvh 10y agoYou 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."
- SEMW 10y ago> 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.
- choward 10y agoThat's true, but the odds are way lower.