Core Concepts

Leaf (Terminal Node)

A leaf is a vertex with degree one. In simpler terms, it's a node that has exactly one connection to another node. Leaves are the endpoints of a tree structure.

Root

The root is the topmost node of a rooted tree, from which the rest of the tree descends. It is the only node that has no parent.

Key Differences

Feature Root Leaf
Degree Can be any degree (1 or more) Always has degree 1
Parent Has no parent Has exactly one parent
Children Can have zero or more children Has zero children
Hierarchy The highest level (level 0) The lowest level(s) of its branch
Requirement Only exists in a rooted tree Exists in both rooted and unrooted trees

Special Case: When Root and Leaf Are Equal

There is exactly one scenario where a root is also a leaf: in the trivial tree consisting of only one single vertex.

In this case, the single vertex is designated the root, and this single vertex also has a degree of zero (or one, depending on definition), making it a leaf.

As soon as a tree has two or more vertices, the root and leaf are distinct.