Professional Documents
Culture Documents
TREES
A tree data structure is a non-linear data structure because it does
not store in a sequential manner. It is a hierarchical structure as
elements in a Tree are arranged in multiple levels. In the Tree data
structure, the topmost node is known as a root node.
ROOT NODE
BASIC TERMINOLOGY
• The node which has at least one child is called Internal node.
They are also called non-leaf or non-terminal nodes.
– A,B,C,D,G are internal nodes
• The node which does not have a child is called External node.
They are also called leaf or terminal nodes.
– E,F,J,K,H,I are external nodes
• In a tree each step from top to bottom is called as level and
the level count starts with 0 and incremented by 1 at each
step.
– A is at level 0. B,C,D are at level 1. E,F,G,H,I are at level 2. J,K are at
level 3.
BASIC TERMINOLOGY
B C
D E F G
BINARY TREES