Tree Fundamentals
A tree is a hierarchical, non-linear data structure composed of nodes connected by edges. A tree has no cycles, and for n nodes it contains exactly n-1 edges. The root is the topmost node. A node with no children is a leaf. An edge connects two nodes. Depth is the number of edges from the root to a node. Height of a node is the number of edges on the longest downward path to a leaf; the height of the tree is the height of its root.
Node: Individual element in a tree.
Root: Topmost node with no parent.
Leaf: Node with no children.
Edge: Connection between two nodes.
Depth: Distance in edges from root to a node.
Height: Longest downward path measured in edges.