big o - Big O notation for a function with x=>0 -


how should represent function f(x)=2x+1 x->0 big o notation?

with reasons please.

(i think should written o(x) function seems grow faster constant function while 1 of classmate think should written o(1).)

big-o notation, in nutshell, tells performance of algorithm relative size of input. i.e. can use express "on small input, algorithm fast, double input size algorithm becomes 4 times slower...".

your algorithm's performance constant. doesn't iterate or multiples increased size of input. beyond implementation minutiae optimisation, return result in same amount of time.

so it's o(1).

you cannot express value of result using big-o.


Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -