static void dfs ( int u , int depth ) {
  for ( int v : adj [ u ] ) {
    dfs ( v , depth + 1 ) ;
  }
  ans = max ( ans , depth ) ;
}

static void dfs ( int u , int depth ) { for ( int v : adj [ u ] ) { dfs ( v , depth + 1 ) ; } ans = max ( ans , depth ) ; }
(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))) body: (block (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))))))