teach-ict.com logo

THE education site for computer science and ICT

2. Binary Tree and Parts of a Tree

There are a standard set of terms to describe part of a tree. These are as follows:

Tree: Describes the entire data structure

Node: A single item within the tree

Branch: a branch connects one node to another. On paper it is shown as a line joining the node pair.

 

Nodes are classified by their position within a tree:

Root: The highest node in a tree (or subtree). All other items ultimately connect back to the root via branches.

Child and Parent nodes: If a node is one position higher in the tree than another, it is called a 'parent node'. Nodes one position lower, connected by branches, are 'child nodes'

 

Subtrees are sections of a tree comprising a parent node and all of the child nodes below it.

Binary trees are a type of tree that is limited in having only two child nodes per parent node. Regular trees have no such limit.

binary tree

In the above tree diagram, A is the root node. It is connected via branches to B and C.

B is a parent node to its child nodes D and E, while C is the parent node to F.

The area 1., highlighted in green, could be labelled as a sub-tree within the tree,

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: parts of a tree structure