Mental Model
A tree is like a family tree where each node has a place, starting from the root and ending at leaves, with height and depth telling how far nodes are from the root or leaves.
Analogy: Imagine a family tree: the oldest ancestor is the root, children are branches, and those with no children are leaves. Height is how tall the tree is from bottom to top, depth is how far a person is from the oldest ancestor, and level is just depth plus one.
Root (Level 1, Depth 0)
/ \
Node1 Node2
/ \ \
Leaf1 Leaf2 Leaf3
Legend:
- Root: top ancestor
- Leaf: no children
- Level: distance from root + 1
- Depth: distance from root
- Height: longest path to leaf