Function to find height of a tree
def height ( root ) : NEW_LINE INDENT global ans , k , lh , rh , f NEW_LINE if ( root == None ) : NEW_LINE INDENT return 0 NEW_LINE DEDENT left_height = height ( root . left ) NEW_LINE right_height = height ( root . right ) NEW_LINE DEDENT