#################################################    
class avlTree(object):    
    class avlnode(object):
         def __init__(self, key):
              # The node's key
              self.key = key
              # The node's left child
              self.left = None
              # The node's right child
              self.right = None
    #--------------------------------------------          
         def __str__(self):
             "String representation."
             return str(self.key)
    #-------------------------------------------- 
         def __repr__(self):
             "String representation."
             return str(self.key)
    #---------------------------------------------
    def __init__(self):
        "Construct."
        # Root node of the tree.
        self.node = None
        # Height of the tree.
        self.height = -1
        # Balance factor of the tree.
        self.balance = 0
    #---------------------------------------------  
    def insert(self, key):

    #---------------------------------------------        
    def rebalance(self):

    #--------------------------------------------- 
    def update_heights(self, recursive=True):

    #---------------------------------------------
    def update_balances(self, recursive=True):

    #--------------------------------------------            
    def rotate_right(self):

    #--------------------------------------------
    def rotate_left(self):

    #--------------------------------------------
    def delete(self, key):

    #-------------------------------------------- 
    def inorder_traverse(self):

    #------------------------------------------- 
    def display(self, node=None, level=0):

    #-------------------------------------------- 


