[ Jiren ]
I think I understand where have I mistaken.
O(n) means the set of all the possible functions where the highest growing term is less than equal to n (highest growing term $\leq$n).
Ex: 2n+3 $\in$ O(n), 1 $\in$ O(n), 1000 $\in$ O(n), logn + 34 $\in$ O(n)
Now if we take f(n) = 1, g(n) = n, then:
1 $\leq$ k*n $\Rightarrow$1 = O(n) $\Rightarrow$f(n) = O(n)
and also if we take g(n) = 1:
1 $\leq$ k*1 $\Rightarrow$1 = O(1) $\Rightarrow$ f(n) = O(1)
But it does not mean that O(n) = O(1)
because f(n) = O(n) actually means f(n) $\in$ O(n) and f(n) = O(1) means f(n) $\in$ O(1)
But we can say that O(1) $\subset$ O(n), because all functions is available in O(n) which are in O(1) but converse is not true.
Please correct me if I have said anything wrong!!