Full Binary Tree vs Complete Binary tree
For a full binary tree, every node has either 2 children or 0 children.
Example 1:
In the given binary tree there is no node having degree 1, either 2 or 0 children for every node, hence it is a full binary tree.
For a complete binary tree, elements are stored in level by level and not from the leftmost side in the last level. Hence this is not a complete binary tree. The array representation is:
Example 2:
In the given binary tree there is no node having degree 1. Every node has a degree of either 2 or 0. Hence it is a full binary tree.
For a complete binary tree, elements are stored in a level by level manner and filled from the leftmost side of the last level. Hence this a complete binary tree. Below is the array representation of the tree:
Example 3:
In the given binary tree node B has degree 1 which violates the property of full binary tree hence it is not a full Binary tree
For a complete binary tree, elements are stored in level by level manner and filled from the leftmost side of the last level. Hence this is a complete binary tree. Array representation of the binary tree is:
Example 4:
In the given binary tree node C has degree 1 which violates the property of a full binary tree hence it is not a full Binary tree
For a complete binary tree, elements are stored in level by level manner and filled from the leftmost side of the last level. Here node E violates the condition. Hence this is not a complete binary tree.
Complete Binary Tree
We know a tree is a non-linear data structure. It has no limitation on the number of children. A binary tree has a limitation as any node of the tree has at most two children: a left and a right child.