Unit content
Rooted trees
A rooted tree chooses one vertex of a tree as the root and interprets every other vertex relative to it.
Each non-root node has one parent: the adjacent node on the unique path toward the root. Nodes farther from the root are its children.
A node with no children is a leaf. The depth of a node is the number of edges from the root to that node; the root has depth zero.
Every node together with all of its descendants defines a subtree.
Rooting adds direction and hierarchy to an otherwise symmetric tree. The same structure underlies directory trees, expression trees, search trees, heaps and many hierarchical data models.