I need help proving that if f(n) = O(g(n)) implies 2^(f(n)) = O(2^g(n)))

前端 未结 3 762
闹比i
闹比i 2020-12-30 08:30

In a previous problem, I showed (hopefully correctly) that f(n) = O(g(n)) implies lg(f(n)) = O(lg(g(n))) with sufficient conditions (e.g., lg

3条回答
  •  佛祖请我去吃肉
    2020-12-30 09:04

    Well, it's not even true to begin with.

    Let's say algorithm A takes 2n steps, and algorithm B takes n steps. Then their ratio is a constant.

    But the ratio of 22n and 2n is not a constant, so what you said doesn't hold.

提交回复
热议问题