Showing posts with label DS. Show all posts
Showing posts with label DS. Show all posts

Thursday, 18 May 2017

Properties Of Binary Trees

Trees are non linear data structures mostly used for hierarchical representation.
A binary tree is a tree in which every node will have at most two children. Before going to the properties of such binary trees,let us see two important types of binary trees.

Complete Binary Tree

It is the binary tree in which all levels except the last,is completely filled and all the nodes are as far left as possible.

Example 


       
                 
               

Almost Complete Binary Tree


A binary tree is said to be almost complete binary tree when all the leaves of the tree are either at d or d-1 level.here, d is the depth of the tree.