Saturday 27 July 2013

difference between Full Binary Tree and Complete Binary Tree

topics
Full Binary Tree
Complete Binary Tree
1.node assemble
it's a regular binary tree with no odd number of leaves.
Every node or level of a tree is completely filled exception can happen only in the last level.

 2.last node
Last and each node must have either 0 (zero) or 2 (two) children.
Children on the last level node must start from the left most position with no spot left unoccupied in between any tow form the left counting.

3.application
 n/a
 Some specific data structure type (i.e. Heaps) need to be in Complete Binary Tree shape, when they need not to be a Full Binary Tree.

4.formula   
If one can find any of

  •  Number of Total Nodes or
  •  Number of Laves or
  •  Number of Internal Nodes
can find the other 2 at instant.

 In complete binary tree there is no relating connection among these 3 attributes.
5. leaf level
Not necessarily have to be in the same depth.
Tree must have the entire leaves node in the exact same depth.

6. diagram
     
   




3 comments:

  1. In the diagram of full binary there is an odd number of leaves.

    ReplyDelete
  2. It's a mistake. A full binary tree is a tree with degree-2 nodes and leaves. There are no odd degree nodes i.e no nodes with only one child.

    ReplyDelete
  3. It's a mistake. A full binary tree is a tree with degree-2 nodes and leaves. There are no odd degree nodes i.e no nodes with only one child.

    ReplyDelete