public static void findMaxHeight ( int node , int currentHeight , ArrayList < Integer > [ ] adj , boolean [ ] visited , int [ ] maxHeight ) {
  if ( currentHeight > maxHeight [ 0 ] ) {
    maxHeight [ 0 ] = currentHeight ;
  }
  visited [ node ] = true ;
  for ( int i = 0 ;
  i < adj [ node ] . size ( ) ;
  i ++ ) {
    findMaxHeight ( adj [ node ] . get ( i ) , currentHeight + 1 , adj , visited , maxHeight ) ;
  }
}

public static void findMaxHeight ( int node , int currentHeight , ArrayList < Integer > [ ] adj , boolean [ ] visited , int [ ] maxHeight ) { if ( currentHeight > maxHeight [ 0 ] ) { maxHeight [ 0 ] = currentHeight ; } visited [ node ] = true ; for ( int i = 0 ; i < adj [ node ] . size ( ) ; i ++ ) { findMaxHeight ( adj [ node ] . get ( i ) , currentHeight + 1 , adj , visited , maxHeight ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (generic_type (type_identifier) (type_arguments (type_identifier))) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier) (identifier))))))))