public static long dsf ( ArrayList < Node > adj [ ] , Node des , int src , boolean [ ] vis ) {
  if ( vis [ des . nod ] ) return cost ;
  cost += des . val ;
  vis [ des . nod ] = true ;
  for ( Node x : adj [ des . nod ] ) {
    if ( x . nod != src ) dsf ( adj , x , des . nod , vis ) ;
  }
  return cost ;
}

public static long dsf ( ArrayList < Node > adj [ ] , Node des , int src , boolean [ ] vis ) { if ( vis [ des . nod ] ) return cost ; cost += des . val ; vis [ des . nod ] = true ; for ( Node x : adj [ des . nod ] ) { if ( x . nod != src ) dsf ( adj , x , des . nod , vis ) ; } return cost ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier)))) consequence: (return_statement (identifier))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier))) right: (true))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (field_access object: (identifier) field: (identifier)) (identifier))))))) (return_statement (identifier))))