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) in o(g(n)) means c · g(n) upper bound on f(n). there exists constant c such f(n) ≤ c · g(n) holds sufficiently large n (i.e. , n ≥ n0 constant n0).

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

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -