Open In App

Balanced Binary Tree definition & meaning in DSA

Last Updated : 26 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Balanced binary tree is defined as a binary tree data structure where there is no more than one height difference between the left and right subtrees of any given node. 

Mathematically Height of left subtree – Height of right subtree ≤1

Balanced and Unbalanced Binary Tree

Balanced and Unbalanced Binary Tree

Properties of Balanced Binary Tree:

  •  A balanced binary tree has a height that is logarithmic in the number of nodes, or O(log n), where n is the total number of nodes. 
  • Search, insertion, and deletion operations can be carried out in effectively because the height of the tree does not increase abruptly as the number of nodes rises.
  • The height difference between a node’s left and right subtrees determines a node’s balance factor in a balanced binary tree. The balance factor of each node is always at most 1.

 How to identify a height-balanced Binary Tree?

Using Recursion we can identify whether the tree is balanced binary tree or not by calculating the height of the left and right subtree for each node and checking the condition and then calling the recursive function till we reach the base case.

To learn more about the identification process and implementation of the same, refer to this article.

What else can you read?


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads