You will have to go to the formal definition of the big O (O
) in order to answer this question.
The definition is that f(x)
belongs to O(g(x))
if and only if the limit limsupx → ∞ (f(x)/g(x))
exists i.e. is not infinity. In short this means that there exists a constant M
, such that value of f(x)/g(x)
is never greater than M
.
In the case of your question let f(n) = n ⋅ 2n
and let g(n) = 2n
. Then f(n)/g(n)
is n
which will still grow infinitely. Therefore f(n)
does not belong to O(g(n))
.