0 0 votes I am stuck after JAN. It is not getting balanced even after 2 rotations. Can somebody help? Data Structures ace-test-series data-structures binary-search-tree avl-tree + – Tushar Shinde 1.7k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments Sumit1311 commented Jan 15, 2016 i edited by Sumit1311 Jan 15, 2016 reply Follow flag 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 0 replyShare Sara commented Jan 19, 2016 reply Follow flag What is the answer?? Getting Dec as left child.. 0 0 replyShare Sumit1311 commented Jan 20, 2016 reply Follow flag Yes. me too. @Tushar is it correct? 0 0 replyShare Please log in or register to add a comment.
1 1 vote 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 2 2 Comments reply Sourabh Kumar commented Apr 29, 2016 reply Follow flag March 0 0 replyShare Jhalak Hota commented Nov 29, 2016 reply Follow flag THhe trick is sort the months as the come in calender not alphabatically . Here is the final balanced tree 0 0 replyShare Please log in or register to add a comment.
0 0 votes Option c is right. abhishekmehta4u answered Mar 6, 2019 abhishekmehta4u comment Share Follow 0 reply Please log in or register to add a comment.