balanced binary search trees fig avl tree case --no pivot node fig avl tree case --no rotate case adjust balances the pivot node exists furtherthe subtree of the pivot node in which the new node was added has the smaller height in this casejust change the balance of the nodes along the search path from the new node up to the pivot node the balances of the nodes above the pivot node are unaffected this is true because the height of the subtree rooted at the pivot node is not changed by the insertion of the new node figure depicts this case the item with key is about to be added to the avl tree the node containing the is the pivot node since the value to be inserted is less than and the balance of the node containing is the new node could possibly help to better balance the tree the avl tree remains an avl tree the balance of nodes up to the pivot must be adjusted balances above the pivot need not be adjusted because they are unaffected figure depicts what the tree looks like after inserting into the tree case the pivot node exists this timehoweverthe new node is added to the subtree of the pivot of larger height (the subtree in the direction of the imbalancethis will cause the pivot node to have balance of - or after inserting the new nodeso the tree will no longer be an avl tree there are two subcases hererequiring either single rotation or double rotation to restore the tree to avl status call the child of the pivot node in the direction of the imbalance the bad child subcase asingle rotation this subcase occurs when the new node is added to the subtree of the bad child which is also in the direction of the imbalance the solution this copy belongs to 'acha