TREE | Data Structure

Tree

Definition: A non-linear data structure is called tree.


Note : 

👉 The line drawn from a node N of tree T to a successor (child) is called an edge


👉 A binary tree is defined as a finite set of element is called nodes.


👉 Those nodes which have no parent is called root node.


👉 Those node which have no child is called leaf node.


Example:




👉 The level of root node is zero and each child level is one more than root level.


👉 Maximum number of node in a branch of tree t is called depth of tree and this turns out to be 1 more than the largest number of level number of tree T.


Example: From above diagram


The depth of tree = largest number of level in tree + 1

                         = 4 + 1

                         = 5

So the depth of tree will be 5



👉 A set of general tree is called forest tree.


Example:



No comments:

Post a Comment