I have an algorithm that is based on a tree and depends on two input sizes n and m, where n is the number of edges a node can have and m is the number of leaves.
I want to find Big-O of an algorithm that traverses said tree and it The complexity breaks down to the following formula for the number of nodes.
$m = n^x$
$x = \log_n(m)$equation:
$$\frac{n^{x+1}-1}{n - 1} = \frac{n\cdot n^x-1}{n - 1} = \frac{n\cdot n^{\log_n(m)}-1}{n - 1} = \frac{nm - 1}{n-1} = O(?)$$$\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.