Tree Components
- Identify the various components of a rooted tree structure.
In the tree structure below, each circle that contains a value is called a node.

The first node from where the tree originates is called the root node.
The tree creates a hierarchical structure where except for the root node, every other node has a parent and zero or more children.
The nodes with no children are called leaves.
Exercise Given the tree structure above, complete the table below:
Answer | |
---|---|
The root is | |
The leaves are | |
The parent of node with value is | |
The children of node with value are |
Solution
Answer | |
---|---|
The root is | |
The leaves are | |
The parent of node with value is | |
The children of node with value are |
The nodes which belong to the same "parent" are called siblings!
The parent-child relationship between nodes can be extended to ancestors and descendants.
For example,
- The nodes , , and are ancestors of .
- The nodes , , , and are descendants of .
The root is an ancestor of every node in a tree, and every node is a descendant of the root.
Resources
- Wikipedia's entry on Tree (data structure), Terminology.