Question

In an AVL tree, what happens if a node insertion causes the balance factor of a node to become +2 or -2?

A The tree becomes unbalanced and cannot be used.
B A rotation or double rotation is performed to restore balance.
C The insertion is rejected to maintain balance.
D The height of the tree increases by 2.
E The balance factor is ignored.
Practice Next

Hey! Ask a query