Driver code
public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; tree . root . left . left = new Node ( 4 ) ; tree . root . left . right = new Node ( 5 ) ; tree . root . left . left . left = new Node ( 8 ) ; if ( tree . isBalanced ( tree . root ) ) { Console . WriteLine ( " Tree ▁ is ▁ balanced " ) ; } else { Console . WriteLine ( " Tree ▁ is ▁ not ▁ balanced " ) ; } } }