static 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 ) ;
}

static 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 ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (return_statement (parenthesized_expression (binary_expression left: (parenthesized_expression (ternary_expression condition: (binary_expression left: (identifier) right: (identifier)) consequence: (identifier) alternative: (identifier))) right: (decimal_integer_literal))))))