Complete Binary Tree: Definition, Properties, and Applications
☰Fullscreen
Table of Content:
A binary tree is said to be a complete binary tree in data structure if it meets the following conditions
- All the levels except possibly the last level have the maximum number of possible nodes.
- All the nodes in the last level appear as far left as possible. That is, at the last level, there should not be any right successor of a parent not without a left successor
Following is an example Complete Binary Tree
Following is an example Almost Complete Binary Tree
Following is a not Almost Complete Binary Tree
For example, the above-given figure of Binary Tree is not a Complete Binary Tree because the last level starts with no left children of D, even if D and E were having 2 children each, still it could not be a Complete Binary Tree as because F doesn't have a left successor. of a complete binary tree