private static void dfs ( Node n , long depth ) {
  n . depth = depth ;
  n . visited = true ;
  for ( Edge e : n . edges ) {
    if ( ! e . to . visited ) dfs ( e . to , depth + e . dist ) ;
  }
}

private static void dfs ( Node n , long depth ) { n . depth = depth ; n . visited = true ; for ( Edge e : n . edges ) { if ( ! e . to . visited ) dfs ( e . to , depth + e . dist ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (true))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (field_access object: (identifier) field: (identifier)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))))))))