Which computational complexity is larger, $O(2^n)$ or $O((\log{n})^{\log{n}})$?

95 Views Asked by At

Doing algorithm complexity analysis in my assignments, but don't know how to compare these two algorithm complexity,

$O(2^n)$ and $O((\log{n})^{\log{n}})$

Which one is larger and why?

1

There are 1 best solutions below

0
On BEST ANSWER

Intuitively, exponents matter much more than bases, so $2^n \gt \log n^{\log n}$
To be more careful $2^n=e^{n \log 2}, \log n^{\log n}=e^{\log n \log \log n}$ so you just need $n \log 2 \gt \log n \log \log n$