Binary Trees

http://install4install.com

Binary Trees are the data structure defined by collection of elements called nodes.They are one of the efficient data structures for searching and insertion operations.The topmost node of binary tree is known as ROOT node  pointed by ROOT pointer.Root node has  left child/successor and  right child/successor pointed by left and right pointers(Fig 1).

Fig 1 : A Binary Tree

Fig 1 : A Binary Tree

The left child further may or may not have successors and the right child may/may not have further successors.If nodes are split into further nodes then a tree is formed known as subtree of root.The left node of root(divided into further nodes) are collectively called as left subtree and right node(divided into further nodes) are called as right subtree(Fig 2).Every node in a binary tree has 0,1 or at most 2 successors.The node which does not have any successor is called as leaf node or terminal node.

Fig 2 : A Binary Tree

Fig 2 : A Binary Tree

 

Terms associated with Binary Tree

Fig 3 : Tree

Screen Shot 2014-05-01 at 3.08.58 PM

Fig 4 : Levels in binary tree

 

 

Screen Shot 2014-05-01 at 3.23.02 PM

Fig 5 : Degree of nodes

 

 

n = 2h -1
n + 1 =2h
log(n+1) = log(2h)
 log2(n+1) = h

 n is the number of nodes and h is the height of tree. The height of binary tree is at least n and at most log2(n+1).

 

 



Short URL: http://tinyit.cc/4ef084
Author: Cusp2207 on May 2, 2014
Category: Computer Science, Data Structures
Tags:

Leave a Reply

Last articles