I am trying to fully understand how to get Big-Oh. Consider the following:
Prove f(n) = O(g(n))
f(n) = 3n + 2
g(n) = n
According to the rules of asymptotic notation listed here
in order for this to be true:
3n + 2/n = c, where c is a constant.
this becomes:
3n/n + 2/n
which results in:
3 + 2/n
I know for a fact that f(n) = O(g(n)). However, I do not understand how using the limit method proves this. Moreover, in this other example:
Prove f(n) = O(g(n))
f(n) = 3*n^2
g(n) = n
this is not true, but why? If someone could provide me a step by step explanation I would be grateful. Examples taken from here