[英]Time complexity of 2^O(log(n))
I'm working on a practice exam and came across this problem:我正在参加练习考试并遇到了这个问题:
True or false: 2 O(log(n)) = O(n).
对或错:2 O(log(n)) = O(n)。
I'm not really sure how to figure this out.我不确定如何解决这个问题。
I wanted to try to apply the definition for big-o, but I'm not sure how that works with it because of the power of two.我想尝试应用 big-o 的定义,但由于两个的力量,我不确定它是如何工作的。
Mathematically this is false, because e != 2
it should be e^O(logn) = O(n)
, but i guess it depends on the context because in terms of time complexity of a function or program, this almost true.在数学上这是错误的,因为
e != 2
它应该是e^O(logn) = O(n)
,但我想这取决于上下文,因为就 function 或程序的时间复杂度而言,这几乎是正确的。 If the question specifies its base 2 log though, it is totally true.如果问题指定了它的base 2 log,那是完全正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.