Level of tree, General tree and Binary tee

Level of tree

The level of tree is representes level of tree which must be started with zero. The level nuber of root node is zero.

Height of tree

The height of tree is equivalent to the maximum number of level+1.
The height of tree=Level of tree+1

The  height of above tree is=3+1=4

General tree

In this tree any node can have more than two child.

Binary tree

In binary tree each node can have maximum two children .In other words in case of binary tree any node consist of zero ,one or two children.


Property of binary tree

  • In binary tree each nod can have maximum two children.
  • In binary tree total edges equivalent of number of (node-1).   Total edges= Number of node-1
      Total edges=8-1=7     (see above figure binary tree)  
  • In this tree maximum number of node are 2h-1   
    where h= height of tree              
Height of tree=level+1
            =2+1
  = 3
maximum number of node= 2h-1    
                                     =23-1
                                 = 7
<
  • In binary tree each level can have maximum 2i nodes
     i=level of node

Next topic is coming soon

I hope this post is useful for you..
thank uuuuuuuuuuuu



Comments

Post a Comment

Popular posts from this blog

python pattern programming

Decision making statement in python

Looping statement in python