3
$\begingroup$

I know that it doesn’t have to be balanced so in theory given that the height of the tree is $h$, the minimal number of nodes is obtained when each node has 1 key and 1 child, and since the first level "doesn’t count" in the height, I should have $h+1$ nodes.

The maximal number of nodes in a $M-way- tree$ should be $\Sigma^h_{i=0} M^i$, when $i$ is the tree level.

Is this correct ? Thank you!

$\endgroup$

1 Answer 1

1
$\begingroup$

This looks correct.

Note that the sum of the geometric series can be expressed more concisely:

$$\sum\limits_{i = 0}^{h} M^{i} = \frac{M^{h + 1} - 1}{M - 1}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.