Question

Prove max(O(f(n)), O(g(n)))=O(max(f(n), g(n))

It does make sense, but so far I don't have any idea how to actually prove it.

Any input would be appreciated.

Était-ce utile?

La solution

f(n) <= max(f(n), g(n))
g(n) <= max(f(n), g(n))

max(O(f(n)), O(g(n))) <= O(max(f(n), g(n)), max(f(n), g(n))) = O(max(f(n), g(n)))

Note that the in-equalities used are not strict.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top