What is an AVL tree?
Options
- A. a tree which is balanced and is a height balanced tree
- B. a tree which is unbalanced and is a height balanced tree
- C. a tree with atmost 3 children
- D. a tree with three children
A. a tree which is balanced and is a height balanced tree
An AVL Tree is a self-balancing Binary Search Tree (BST).
For every node,
Height difference (Balance Factor) between left and right subtree
is -1, 0, or +1
If imbalance occurs, it is fixed using rotations:
Left Rotation
Right Rotation
Left-Right Rotation
Right-Left Rotation
Attempt Quiz Now:
BPSC Tre 4.0 DSA Practice Set