Rooted Trees
A directed tree is a directed graph for which the underlying undirected
graph is a tree.
A directed tree is called a rooted tree if there is a unique vertex ,
called the root so that
has in-degree 0, and all other vertices
have in-degree 1.
A leaf in a rooted tree is a vertex with outdegree zero.
A branch node is a vertex which is not a leaf.
Level of a rooted tree is the level containing all vertices at distance
from the root.
If there is an edge in a rooted tree, then
is a child of
,
and
is the parent of
.
An ancestor of a vertex is a vertex on the path from
to
.
Vertex
is a descendant of
if
is an ancestor of
.
Two vertices with a common parent are called siblings.
The subtree at vertex is the subgraph induced by the root
and
all of its descendants.
A binary rooted tree is such that every vertex has at most two
children. It is a complete binary tree if every branch node has
exactly two children.