notes this is tree which can now be balanced using single right rotation we can now perform our right rotation rooted at the resultb / balance at last avl operation insertion into avl trees to implement avl treesyou need to maintain the height of each node you insert into an avl tree by performing standard binary tree insertion when you're doneyou check each node on the path from the new node to the root if that node' height hasn' changed because of the insertionthen you are done if the node' height has changedbut it does not violate the balance propertythen you continue checking the next node in the path if the node' height has changed and it now violates the balance propertythen you need to perform one or two rotations to fix the problemand then you are done let' try some examples suppose have the following avl tree - now annotate the nodes with their heightseunice fred binky baby daisy luther daisy calista if insert ahmadtake look at the resulting treeeunice fred binky baby daisy daisy ahmed calista luther the new node ahmad has height of zeroand when travel the path up to the rooti change baby daisy' height to one howeverher node is not imbalancedsince the height of her subtrees are and - moving onbinky' height is unchangedso we can stop the resulting tree is indeed an avl tree lovely professional university