Which pair of functions satisfy f (N) ~g(N)?

后端 未结 2 1212
臣服心动
臣服心动 2021-01-28 04:42

I\'ve just started working with algorithms and I am doing some tasks like this question:

I think, the right answer is A. As the functions are the same, or do I miss some

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-28 05:45

    Yes, A is the correct answer.

    Tilde here means an (approximate, not precise) equivalence relation. Or in other words, the limit of f(N) / g(N) as N approaches infinity = 1.

    In answer A, f and g are obviously equivalent, so the limit is 1. This doesn't hold for the other three answers, which have limits 3, 0, and 3 respectively.

提交回复
热议问题