Looking for a way to find the proportional growth rate in time for any given notation

83 Views Asked by At

I am wondering if there is a straight forward way to illustrate the proportional growth rate in time (or space) for any given notation such as $O(n^2)$ or $O(logn)$?

My initial thought is that $O(n^2)$ would be equal to $O(n)*O(n)$ but I'm sure that's completely wrong.

1

There are 1 best solutions below

0
On BEST ANSWER

We say that $f(n)=O(g(n))$ iff:

There exist constants $c,n_0$ such that for all $n\ge n_0$, if $c>0$, then $0 \le f(n) \le c \cdot g(n)$.

Also, recall that $y$ is proportional to $x$ simply if $y=kx$ for some constant $k$.

Thus, suppose some algorithm had a running time of $f(n)=O(n^3)$. Then we can conclude that this algorithm's (time or space) growth rate is proportional to $n^3$. For example, it might be the case that $f(n)=4n^3$ or $f(n)=50n^3$.