Complete Binary Tree

Rumman Ansari   Software Engineer   2023-03-27   6508 Share
☰ Table of Contents

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

binary tree

Following is an example Almost Complete Binary Tree

binary tree binary tree

Following is a not Almost Complete Binary Tree

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

Few Properties

Node at level r

binary tree

Depeth or height

binary tree