Is O(n) greater than O(2^log n)
问题 I read in a data structures book complexity hierarchy diagram that n is greater than 2 log n . But cannot understand how and why. On using simple examples in power of 2 as n, I get values equal to n. It is not mentioned in book , but I am assuming it to base 2 ( as context is DS complexity) a) Is O(n) > O(pow(2,logn)) ? b) Is O(pow(2,log n)) better than O(n) ? 回答1: Notice that 2 log b n = 2 log 2 n / log 2 b = n (1 / log 2 b) . If log 2 b ≥ 1 (that is, b ≥ 2), then this entire expression is