Tree Data Structure

What is a tree ?

A general tree is a tree where each node may have zero or more children. Tree is a non-linear data structure which organizes data in hierarchical structure.
Every element is called a Node. Node stores data of that element and link to other element in hierarchical structure.

Tree Terminology


In a tree data structure, the first node is called as Root Node. It is the origin of the data structure. Every tree must have root node.


The connecting link between any two nodes is called as Edge.


The node which is predecessor of any node is called as Parent node.


The node which is descendent of any node is called as Child node.


The node which does not have a child is called as Leaf node.   

Internal nodes

The node which has at least one node is called as Internal node.

Sub tree

Sub tree represents the descendants of a node. Each child from a node forms a subtree recursively.


File systems, family tree etc

Figure : Tree for File System

Next >
Scroll to Top