With trees, induction is useful. We'll use induction on the height,
.
We must prove that the inductive hypothesis is true for height
.
Let
. Note that the theorem is true (by the
inductive hypothesis) of the subtrees of the root, since they have
height
.
Thus, the inductive hypothesis is true for height
and, hence
(by induction), true for all heights. A complete binary tree of
nodes has height
.