我刚刚开始使用算法,并且正在执行类似此问题的某些任务:
I've just started working with algorithms and I am doing some tasks like this question:
我认为正确的答案是A.由于功能相同,还是我错过了一些事情?
I think, the right answer is A. As the functions are the same, or do I miss something?
问题:
推荐答案
答案是A.请注意,在这种情况下,
The answer is A. Notice that in that case,
f(N)= N + 2N + 3N = 6N = g(N)
f(N) = N + 2N + 3N = 6N = g(N)
所以f(N)〜g(N).
so f(N) ~ g(N).
对于B中给出的功能,请注意
For the functions given in B, notice that
f(N)=(N +1)+(N + 2)+(N + 3)= 3N + 6
f(N) = (N + 1) + (N + 2) + (N + 3) = 3N + 6
所以当N趋于无穷大时,f(N)/g(N)的极限为3,因此f(N)不等于g(N)的波浪线.
so the limit of f(N) / g(N) as N tends toward infinity is 3, and therefore f(N) is not tilde of g(N).
对于C中的功能,请注意
For the functions in C, notice that
f(N)/g(N)= 1/N 5 +1/N 4 +1/N 3
f(N) / g(N) = 1 / N5 + 1 / N4 + 1 / N3
而且,在极限情况下,这不会趋向于一个.
and, in the limit, this does not tend to one.
对于D中的功能,请注意
For the functions in D, notice that
f(N)=对数N +对数2N +对数3N =对数6N 3 = 3对数6N
f(N) = log N + log 2N + log 3N = log 6N3 = 3 log 6N
因此,当N趋于无穷大时,f(N)在g(N)上的极限为3,因此这些函数不会互相代名词.
so the limit of f(N) over g(N) as N tends toward infinity is 3, so the functions aren't tilde of one another.