1 votes 1 votes Delete the key sequence [6,5,4] from the below AVL tree. How many rotations are needed to make it balanced AVL tree again? DS data-structures avl-tree + – Meghaaa2612 asked Jan 31, 2018 retagged Dec 16, 2023 by Hira Thakur Meghaaa2612 905 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Ashwin Kulkarni commented Jan 31, 2018 reply Follow Share Only 1 rotation is required. After deleting [6,5,4] there will be L-L and L-R both imbalances for node 3. Then L-L will take only 1 rotation and will balance it. Actually in the question they have to mention about "minimum" word. the resultant tree - 1 0 3 2 1 votes 1 votes Meghaaa2612 commented Feb 1, 2018 reply Follow Share Thanks I was having same doubt. 0 votes 0 votes Himanshu Kumar Gupta commented Aug 24, 2020 reply Follow Share i think only 1 rotation are needed... 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes delete 6 - no rotation is required delete 5 - tree will be like 3 1 4 0 2 at this point tree is balanced now delete 4 delete 4 root become unbalanced it will rotate to the right. tree will become like : 1 0 3 2 So only one rotation is needed. psb answered Mar 21, 2018 selected Mar 21, 2018 by srestha psb comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes one right rotation abhishekmehta4u answered Mar 21, 2018 abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.