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 2121 is
The children of node with value 55 are
Solution
Answer
The root is99
The leaves are4,8,14,20,254, 8, 14, 20, 25
The parent of node with value 2121 is1717
The children of node with value 55 are2,72, 7

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 2121, 1717, and 99 are ancestors of 2525.
  • The nodes 22, 77, 44, and 88 are descendants of 55.

The root is an ancestor of every node in a tree, and every node is a descendant of the root.

Resources