Last Updated :
18 Dec, 2018
Construct the AVL tree for given input: 14, 17, 11, 7, 53, 4, 13, 12, 5, 9. What is total number of rotations required for contracting this AVL tree? (Assume that LR rotation as 1 rotation and RL as 1 rotation).
(A) 3
(B) 4
(C) 5
(D) None of these
Answer: (A)
Explanation: Total rotation are as follows on insertion of 14, 17, 11, 7, 53, 4, 13, 12, 5 and 9:
Therefore, 1-LL, 1-LR, and 1-RL rotations are required.
Option (A) is correct.
Quiz of this Question
Share your thoughts in the comments
Please Login to comment...