How to prove that at Complete Binary Tree (CBT) at height $h$ we have $2^h$ leaves

719 Views Asked by At

I try to prove it by induction, please tell me if I'm right...

The induction assumption - For every CBT at height $h$ there is $2^h$ leaves.
The base of the induction is right (I'm writing this proof shortly).
We have to prove the for a CBT at height $h+1$ there is $2^{h+1}$ leaves.

Proof: We will take a CBT at height $h$ and we will use the induction assumption, then we will put for every leaf at the tree two children.
Then - the height of the tree is $h+1$ and we have amount of leaves as double as before (because every leaf get two children...).

Am I right? Is the proof good? Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

Yes the proof by induction is correct it is only missing a base case, for example:

Base case h=2 and leaves=4 which is 2^2 IS True

The rest follows correctly yes