public static void dfs ( int [ ] dist , Map < Integer , List < Integer >> v , int start , int depth ) {
  if ( dist [ start ] > - 1 ) {
    return ;
  }
  dist [ start ] = depth ;
  for ( int i : v . get ( start ) ) {
    dfs ( dist , v , i , depth + 1 ) ;
  }
}

public static void dfs ( int [ ] dist , Map < Integer , List < Integer > > v , int start , int depth ) { if ( dist [ start ] > - 1 ) { return ; } dist [ start ] = depth ; for ( int i : v . get ( start ) ) { dfs ( dist , v , i , depth + 1 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier) (generic_type (type_identifier) (type_arguments (type_identifier))))) 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: (array_access array: (identifier) index: (identifier)) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (return_statement))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) body: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))