0 votes 0 votes I am stuck after JAN. It is not getting balanced even after 2 rotations. Can somebody help? DS ace-test-series data-structures binary-search-tree avl-tree + – Tushar Shinde asked Jan 15, 2016 • recategorized Mar 6, 2019 by akash.dinkar12 Tushar Shinde 951 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments Sumit1311 commented Jan 15, 2016 i edited by Sumit1311 Jan 15, 2016 reply Follow Share Imbalance is at node May : Now, we have to check which condition apply out of 4: Left subtree has greater height at node May. So Now at node Aug, right subtree has greater height. So applicable case is left-right. so two rotations, First left rotation at node Aug and Then right rotation at node May.' you will get the balanced tree. Just follow the cases while inserting or deleting. 0 votes 0 votes Sara commented Jan 19, 2016 reply Follow Share What is the answer?? Getting Dec as left child.. 0 votes 0 votes Sumit1311 commented Jan 20, 2016 reply Follow Share Yes. me too. @Tushar is it correct? 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Answer is (c) Mar, try assigning numbers in place of months that will make it easy to solve and find result. Gaurav Rawat answered Jan 19, 2016 Gaurav Rawat comment Share Follow See all 2 Comments See all 2 2 Comments reply Sourabh Kumar commented Apr 29, 2016 reply Follow Share March 0 votes 0 votes Jhalak Hota commented Nov 29, 2016 reply Follow Share THhe trick is sort the months as the come in calender not alphabatically . Here is the final balanced tree 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Option c is right. abhishekmehta4u answered Mar 6, 2019 abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.