Full Binary Tree vs Complete Binary Tree
Posted September 12, 2022 by Rohith and Anusha ‐ 1 min read
A full binary tree is a binary tree in which all of the nodes have either 0 or 2 offspring. In other terms, a full binary tree is a binary tree in which all nodes, except the leaf nodes, have two offspring. When all of the levels of a binary tree are entirely filled, except for the last level, which can contain 1 or 2 children nodes and is filled from the left, it is said to be a complete binary tree.
Complete Binary Tree | Full Binary Tree |
---|---|
In a complete binary tree, a node in the last level can have only one child. | In a full binary tree, a node cannot have just one child. |
In a complete binary tree, the node should be filled from the left to right. | There is no order of filling nodes in a full binary tree. |
Complete binary trees are mainly used in heap-based data structures. | Full binary tree has no application as such but is also called a proper binary tree. |
A complete binary tree is also called almost complete binary tree. | A full binary tree also called proper binary tree or 2-tree. |
A complete binary tree must have the entire leaves node in the exact same depth. | In full binary tree leaf level not necessarily have to be in the same depth. |