Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT root = newNode ( 10 ) NEW_LINE root . left = newNode ( 5 ) NEW_LINE root . right = newNode ( 100 ) NEW_LINE root . right . left = newNode ( 50 ) NEW_LINE root . right . right = newNode ( 150 ) NEW_LINE root . right . left . left = newNode ( 40 ) NEW_LINE if ( isBalanced ( root ) ) : NEW_LINE INDENT print ( " Balanced " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ Balanced " ) NEW_LINE DEDENT DEDENT