In a balanced binary tree, the height of two sub-trees of every node can not differ by more than

Options

  • A. 2
  • B. 1
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. 1

Detailed Explanation

Explanation

In a Balanced Binary Tree (especially an AVL tree):

  • The height difference between the left and right subtree of any node is called the balance factor.

  • The balance factor must be −1, 0, or +1.

This means the height difference cannot be more than 1.

Example

If a node has:

  • Left subtree height = 3

  • Right subtree height = 2

Difference = 1 → Balanced ✔

OOps! You are currently offline.