Maximum Number of Vertices in an m-ary Tree

80 Views Asked by At

I'm trying to find a formula for the maximum number of vertices (both internal nodes and leaves) in an m-ary tree with height h.

I think that this is equal to $1+m+m^2+m^3+...+m^h$ because it's m-ary, and then you use the formula for a sum of a geometric series to get $$ \frac{m^{h+1}-1}{m-1}$$

I just wanted to check my work, is this right?