search trees listing partial implementation of the avltree py module constants for the balance factors left_high equal_high right_high - implementation of the map adt using an avl tree class avlmap def __init__self )self _root none self _size def __len__self )return self _size def __contains__selfkey )return self _bstsearchself _rootkey is not none def addselfkeyvalue )node self _bstsearchkey if node is not none node value value return false else (self _roottmpself _avlinsertself _rootkeyvalue self _size + return true def valueofselfkey )node self _bstsearchself _rootkey assert node is not none"invalid map key return node value def removeselfkey )assert key in self"invalid map key (self _roottmpself _avlremoveself _rootkey self _size - def __iter__self )return _bstmapiteratorself _root storage class for creating the avl tree node class _avlmapnode def __init__selfkeyvalue )self key key self value value self bfactor equal_high self left none self right none only change required to the add(and remove(methods is that each method must call an avl specific helper method we provide the implementation for adding new element to an avl tree and leave the removal as an exercise