Height of a binary tree (source code)

= Height of a binary tree
{title2=$h$}

For a nonempty <binary tree>, the largest number of <edges> on a downward <graph path> from its <root of a tree> to a leaf. A single <vertex> has <height of a binary tree> $0$; a chain of $n\geq1$ <vertices> has <height of a binary tree> $n-1$. A convenient <recursion> convention assigns an empty <binary tree> height $-1$, giving $h=1+\max(h_L,h_R)$ for the left and right <subtrees>. A <binary search tree> lookup visits at most $h+1$ <vertices>.