Overview of Tree Data Structure
The tree is an abstract data structure which stores hierarchical data. For example, organisations have a hierarchical structure for employees. It is similar to the image given below. Several sergeants have to report to their respective captain. Now captains report to colonel. This colonel takes order from the general and assigns them to sergeants. Each of these consists of several levels. The general is on level 0, Colonel A and Colonel V are on level 1, Captain A, B and C are on level 2 and so on. Another terminology is height of the tree. The height of a tree is longest path from the root node to any leaf node of the tree. Height of leaf node n=Level of leaf n+1. Suppose we want to find the height of Private A. Height of private A= Level of Private A+1 =4+1 ...