runtime - Big O notation of a constant -
i calculate runtime complexity 4, big o notation of this?
for example if runtime complexity 4 + n big o = o(n).
let's loosely @ definition of mean f(n) in o(g(n)):
f(n)ino(g(n))meansc · g(n)upper bound onf(n). there exists constantcsuchf(n) ≤ c · g(n)holds sufficiently largen(i.e. ,n ≥ n0constantn0).
you can treat constant function other function, w.r.t. analysing asymptotic behaviour using e.g. big-o notation.
f(n) = 4 g(n) = 1 f(n) ≤ c · g(n) = c · 1, c ≥ 4 , n (*) (*) e.g. n0=0 , c=4 => f(n) in o(1) note: ctx notes in comments below, o(1) (or e.g. o(n)) describes set of functions, correct, f should described in o(1) (f ∈ o(n), f:s set membership in o(1)), rather "f(n) being in o(1)". can, however, expect see less rigorous version "f(n) in o(1)" (or o(g(n))) @ web, @ least outside of scope of scientific articles.
Comments
Post a Comment