I am writing an algorithm that needs to finish in $O(m)$. The problem is for a graph $G( V, E )$, where $m = |E|$ and $n = |V|$. $m$ can be in the range of $n-1$ to $n^2 - 1$.
If I do some processing that takes $O\left( (n-3) \log(n-3)\right)$ time, will that still satisfy being smaller than $O(m)$ or not?
Thanks
$m > n - 1$ implies that $(n-3) \log(n-3) < (m-2) \log (m-2)$. That is $O(m \log m)$, but not $O(m)$.