static void dfs ( int u , int p , int h ) {
  if ( max <= h ) {
    max = h ;
    q = u ;
  }
  for ( int v : adj [ u ] ) {
    if ( v != p ) {
      dfs ( v , u , h + 1 ) ;
      if ( v == b ) dist = h + 1 ;
    }
  }
}

static void dfs ( int u , int p , int h ) { if ( max <= h ) { max = h ; q = u ; } for ( int v : adj [ u ] ) { if ( v != p ) { dfs ( v , u , h + 1 ) ; if ( v == b ) dist = h + 1 ; } } }
(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: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))))