In the context of complexity, I have seen both $O(2^{n})$ and $2^{O(n)}$ used.
Whats the difference between the two?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this community$2^{O(n)}$ is larger. For $O(2^n)$ is exactly functions bounded by $K\cdot 2^n$ for some large $K$, while $2^{O(n)}$ includes things like $4^n = 2^{2n}$, which is not $O(2^n)$.
$f(n)=O(2^n)$ means there exists constant $M>0$ such that $\mid f(n) \mid \leq M.2^n$ whereas $f(n)=2^{O(n)}$ means there exists constant $M>0$ such that $\mid f(n)\mid \leq 2^{M.n}$ for large $n$.