Show that if f(n) is O(g(n) and d(n) is O(h(n)), then f(n) + d(n) is O(g(n) + h(n))

673 Views Asked by At

I have just started an algorithm design and analysis class and I am completely lost. We seem to be moving thru material that I am unfamiliar with and my book is terrible. My instructor tried to help but I still do not understand. The question:

Show that if f(n) is O(g(n)) and d(n) is O(h(n)), then the summation f(n) + d(n) is O(g(n) + h(n))

If someone could help me understand this proof and show me the methodology for proving something like this I would be so grateful. This isn't homework, but is similar to stuff we are doing in class and it's going right over my head. Give me the child's explanation if you could.

I have used this as a reference:

Suppose $f(n)$ is $O(g(n))$ and $d(n)$ is $O(e(n))$. How do i use Big O to show that $f (n)$ + $d(n)$ is $O(g(n) + e(n))$?

but im still very confused. Thanks so much in advance.