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?
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?
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$