return height of tree
int heightoftree ( Node * root ) { if ( root == NULL ) return 0 ; int left = heightoftree ( root -> left ) ; int right = heightoftree ( root -> right ) ; return ( ( left > right ? left : right ) + 1 ) ; }