We express complexity using big-O notation. For a problem of size N:
- a constant-time method is "order 1": O(1)
- a linear-time method is "order N": O(N)
- a quadratic-time method is "order N squared": O(N2)
It is a mathematical order notation. Big O notation f(x)=O(g(x)) means, that functions f() and g() are of the same order, i.e., both linear, both quadratical, both exponential etc. More exactly it means, perhaps, that order of g(x) is not bigger than that of f(x). f=O(1) means that f is approximatelly a constant (well, not exceeds some constant limits independent of n). It could be any function convergent to constant or vanishing function like f=1/n.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.