What is balance factor of an AVL tree?

2021

What is balance factor of an AVL tree?

  1. A.

    |h(TL)| ≤ 1

  2. B.

    |h(TR)| ≤ 1

  3. C.

    h(TL) – h(TR)| ≤ 1

  4. D.

    |h(TL) + h(TR)| ≤ 1

Attempted by 652 students.

Show answer & explanation

Correct answer: C

The balance factor of a node in an AVL tree is defined as the difference between the heights of its left and right subtrees.
It is calculated as:
For an AVL tree, the balance factor of every node must be -1, 0, or 1. This ensures the tree remains balanced and maintains O(log n) search time.

Explore the full course: Up Lt Grade Assistant Teacher 2025