I'm not a mathematician by any stretch and I'm trying to translate some maths terms into simple maths terms. Please don't laugh, I do consider this complicated!
The equations in question are
O(n) and O(n ^ 2)
Now, I have read up on Wiki about this but it has been written (IMO) for people who already understand it!
I believe n ^ 2 translates to the power of
, in this case it is also the equivalent of squaring it (i.e. n * n
).
However, I can't get my head around O
in terms of what it is describing. Wiki says it's the limiting behaviour. So, does this mean O
is more of a description than a function or command? In my understanding, the following 2 equations are the same
O(n^2)
n^2
Best Answer
Quickly, $O(n^2)$ is any function $f=f(n)$ such that $$\left| \frac{f(n)}{n^2} \right|$$ remains bounded as $n \to +\infty$. It may be $n^2$ itself, but it may also be $n$, or $\sin \cos n$, etc.