The question is in the title: is it possible to simplify the complexity $O(n\log{}n + \frac{n^2}{m}\log{}m)$ ? $n$ and $m$ are two variables, and you know that $n > m$ (by the way, what if we don't know that?).
What I first thought was that it is possible to reduce it by keeping only the second term: $O(\frac{n^2}{m}\log{}m)$, because the term $n^2$ is dominating the term $n$, even if we divide $n^2$ by $m$. But the more I think about it, the less confident I am about this.
Any idea/explanation? That would help a lot.
Thanks!