Big-$O$ complexity of $n(m+1)$.

48 Views Asked by At

I have an algorithm that takes $n(m+1)$ operations, where $n$ and $m$ are non-negative values. What is the complexity of this algorithm in Big-$O$ notation? I feel tempted to say $O(n(m+1))$ because $(m+1)$ is always positive, and if you say $O(nm)$, then if m is zero $mn$ is zero even as n tends to infinity, so it doesn't describe the asymptotic complexity when $m = 0$, which would be $O(n)$ for $n(m+1)$.