문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top