Introduction to Binary Tree

By | July 14, 2020

A tree is called a binary tree if each note has zero children, one child, or two children, an empty tree is also a valid binary tree. we can visualize a binary tree consisting of a root and two disjoint binary trees called the left and right subtrees of the root.

Generic Binary Tree

Generic Binary Tree

Example of Binary Tree

Binary Tree Example

Types of Binary Trees

  • Strict Binary Tree
  • Full Binary Tree
  • Complete Binary Tree
  • Strict Binary Tree

A binary tree is called a strict binary tree if each node has exactly two or no children.

Strict Binary Tree

  • Full Binary Tree

A binary tree is generally called a Full binary tree if each node has exactly two children and all leaf nodes are at the same level.

Full Binary Tree

  • Complete Binary Tree

Before We define the complete binary tree, let’s assume that the height of the binary tree is h. In case of complete binary trees, if we numbering for the nodes by starting at the root (Let assume the root node is 1) then we get a complete sequence starting from 1 to the number of nodes in the tree while traversing we should be numbering for null pointers as well. A binary tree is called a complete binary tree if all leaf nodes are at height h or h – 1 and without any missing number in the sequence.

Complete Binary Tree

 

You May Also Like:

Introduction to Tree Data Structure
Introduction to Graph Data Structure?
Queue Data Structure
Queue Implementation using an array in java
Queue Implementation using LinkedList in java

That’s all about Introduction to Binary Tree?
If you have any feedback or suggestion please feel free to drop in below comment box.

Leave a Reply

Your email address will not be published.