Driver code
int main ( ) { node * root = newNode ( 1 ) ; root -> left = newNode ( 2 ) ; root -> right = newNode ( 3 ) ; root -> left -> left = newNode ( 4 ) ; root -> left -> right = newNode ( 5 ) ; root -> left -> left -> left = newNode ( 8 ) ; if ( isBalanced ( root ) ) cout << " Tree ▁ is ▁ balanced " ; else cout << " Tree ▁ is ▁ not ▁ balanced " ; return 0 ; }