notes node is the new root of the subtree before the insertionnode ' height was - so the height of the subtree has not changed because of the rotation thusinsertion is overand you are left with valid avl tree if the path from the imbalanced node to the newly added node starts with two left childrenthen you have another zig-zig case (the mirror imageyou treat it in the same wayrotate about the imbalanced node' left child before going ontake look at our example above where fred was imbalanced that is zig-zig caseso we can fix it by rotating about luthereunice eunice baby daisy daisy ahmed calista luther binky baby daisy calista ahmed waluigi daisy luther rotate about luther fred binky fred waluigi the other rebalancing case is the zig-zag casepictured belowb - - - - either is the newly added nodeor it is node in or - or - - or - to fix thisyou perform two rotations you rotate about node dand then you rotate about node again this is called double rotation about node here are the two rotationsb - - - - or - - - or - first rotation about lovely professional university