Big O Notation and Adding functions

69 Views Asked by At

If $f$ is $O(h)$, is $(f-g)$ still $O(h)$, regardless whether $g$ is $O(h)$ or not ?

1

There are 1 best solutions below

3
On

Countereexample:

Suppose $f(x)=x$, hence it is $O(x)$ and $g(x)=x^2$.

Check that $f-g$ is not $O(x)$.