Show that there are at most

Answer
First we know that
we need to proof by induction that:
for the base case we have:
this holds because all the leaves have height 0. Let x be the number of nodes in a heap so that
so the number of leaves is

finally for inductive step we have:
Note: basically the idea is to "remove" each layer of leaves until we reach the ones with de desire heigth.
No comments:
Post a Comment