A rooted tree is a connected, acyclic graph with one distinguished root node. Traversal begins at the root, which leads to the other nodes. Every node can have children and at most one parent; the only node without a parent is the root. section 7.1 section 7.4
The basic vocabulary is straightforward:
- A leaf node has no children. section 7.1
- A tree cannot contain cycles, so following its paths cannot trap you in an infinite loop. section 7.4 section 7.6
- Unlike a general graph, a rooted tree provides a definite starting point. section 7.6
Huffman coding
Huffman coding uses a rooted binary tree: letters appear at leaf nodes, and each letter has one unique path from the root. Reading path digits eventually reaches a letter because the tree has no cycles. A binary tree allows at most two children, conventionally a left and a right child, matching the two possible digits. section 7.6
Use the accompanying figure to identify the root, parent and child relationships, and leaf nodes. section 7.1
