implementing dictionary using an avl tree (assuming the parent class includes an implementation of the restructure methodthis class extends binarysearchtree (code fragments and includes nested classavlnodewhich extends the btnode class used to represent the nodes of binary tree the avlnode class defines an additional instance variable heightrepresenting the height of the node we get our binary tree to use this node class instead of the btnode class simply by overriding the createnode methodwhich is used exclusively to create new binary tree nodes class avltree inherits methods sizeisemptyfindand findall from its superclassbinarysearchtreebut overrides methods insert and remove to keep the search tree balanced method insert (code fragment begins by calling the superclass' insert methodwhich inserts the new entry and assigns the insertion position (for examplethe node storing key in figure to the instance variable actionpos the auxiliary method rebalance is then used to traverse the path from the insertion position to the root this traversal updates the heights of all the nodes visitedand performs trinode restructuring if necessary similarlymethod remove (code fragment begins by calling the superclass' remove methodwhich performs the removal of the entry and assigns the position replacing the deleted one to instance variable actionpos the auxiliary method rebalance is then used to traverse the path from the removed position to the rootperforming any needed restructurings code fragment constructor and auxiliary methods of class avltree