The height of binary tree is maximum of all depths . Find the maximum value in depth [ ] and assign it to ht .
int ht = depth [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) if ( ht < depth [ i ] ) ht = depth [ i ] ; return ht ; }