I have an algorithm that depends on two input sizes n and m. The complexity breaks down to the following equation:$\frac{nm - 1}{n-1} = O(?)$Is Big-O of the Formula $O(mn)$ or $O(m)$ because $n$ cancels out? Thank you in advance!PS: I know that if $O(m)$ is the upper bound $O(mn)$ is an upper bound too, I want to find the tightest.
Simplifying an upper O-bound in two variables
asymptotics;landau notation
I assume that $n\ge 2$, which implies $1/(n-1)\le 2/n$. Then$$ \frac{nm-1}{n-1} \le \frac{nm}{n-1} \le 2  \frac{nm}{n} \le 2m.   $$Thus your expression is bounded by $O(m)$.