How it works
Height, depth, leaves, and internal nodes are defined relative to the root. Height measured in edges differs by one from height measured in nodes, so the convention must be stated.
State your convention before answering any height question.
Common error
Mixing edge and node counts between parts of one answer.
Worked example
Example
Root: 8
Left child: 4, with children 2 and 6
Right child: 12
Height convention: number of edges on longest root-to-leaf pathThe root has no parent. Leaves have no children. Depth counts edges from the root, while height counts the longest downward path under the stated convention. Always establish whether a course counts height in edges or nodes.
Exercises
6.1.1 · Explain
For the displayed tree, identify the leaves and the depth of node 6.
Show solution
The leaves are 2, 6, and 12. Node 6 has depth 2, following edges 8 to 4 to 6.
6.1.2 · Explain
What are the tree height and the height of a leaf under the stated edge-count convention?
Show solution
The tree height is 2. A leaf has height 0.
