Driver function to test the above function
root = Node ( 1 ) NEW_LINE root . left = Node ( 2 ) NEW_LINE root . right = Node ( 3 ) NEW_LINE root . left . left = Node ( 4 ) NEW_LINE root . left . right = Node ( 5 ) NEW_LINE root . left . left . left = Node ( 8 ) NEW_LINE if isBalanced ( root ) : NEW_LINE INDENT print ( " Tree ▁ is ▁ balanced " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Tree ▁ is ▁ not ▁ balanced " ) NEW_LINE DEDENT