I am confused about the terminology of the below trees, I have been studying the Tree, and I am unable to distinguish between these trees:
a) Complete Binary Tree
b) Strict Binary Tree
c) Full Binary Tree
Please help me to differentiate among these trees. When and where these trees are used in Data Structure?
Full/ proper/ strict Binary treeThe full binary tree is also known as a strict binary tree. The tree can only be considered as the full binary tree if each node must contain either 0 or 2 children. The full binary tree can also be defined as the tree in which each node must contain 2 children except the leaf nodes.
A strictly binary tree with n leaves always contains 2n -1 nodes. If every non-leaf node in a binary tree has nonempty left and right subtrees, the tree is termed a strictly binary tree. Or, to put it another way, all of the nodes in a strictly binary tree are of degree zero or two, never degree one.
It is not a full binary tree as node 2 has only one child. The binary tree which is shown below is a complete as well as a full binary tree. It is a complete binary tree as all the nodes are left filled. It is a full binary tree as all the nodes have either 0 or 2 children.
Perfect Tree:
x / \ / \ x x / \ / \ x x x x / \ / \ / \ / \ x x x x x x x x
Complete Tree:
x / \ / \ x x / \ / \ x x x x / \ / x x x
Strict/Full Tree:
x / \ / \ x x / \ x x / \ x x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With