General Tree
|
Binary Tree
|
A general tree is a data structure in that each node can have infinite number of children, |
A Binary tree is a data structure in that each node has at most two nodes left and right. |
A General tree can’t be empty. |
A Binary tree can be empty. |
There is no limit on the degree of node in a general tree. |
Nodes in a binary tree cannot have more than degree 2. |
Subtree of general tree are not ordered. |
Subtree of binary tree are ordered. |
In general tree, root have in-degree 0 and maximum out-degree n. |
In binary tree, root have in-degree 0 and maximum out-degree 2. |
In general tree, each node have in-degree one and maximum out-degree n. |
In binary tree, each node have in-degree one and maximum out-degree 2. |
Height of a general tree is the length of longest path from root to the leaf of tree. Height(T) = {max(height(child1) , height(child2) , … height(child-n) ) +1} |
Height of a binary tree is : Height(T) = { max (Height(Left Child) , Height(Right Child) + 1} |
|
|