A balance factor in AVL tree is used to check

2024

A balance factor in AVL tree is used to check

  1. A.

    what rotation to make.

  2. B.

    if all child nodes are at same level.

  3. C.

    when the last rotation occurred.

  4. D.

    if the tree is unbalanced.

Attempted by 320 students.

Show answer & explanation

Correct answer: D

Answer : D

Explanation

The balance factor (BalanceFactor = height(left-sutree) − height(right-sutree)) is used to check if the tree is balanced or unbalanced.

Explore the full course: Cocubes Preparation