static void dfs ( int prev , int u ) {
  if ( c [ u ] != c [ prev ] ) sum ++ ;
  for ( int v : adj [ u ] ) if ( v != prev ) dfs ( u , v ) ;
}

static void dfs ( int prev , int u ) { if ( c [ u ] != c [ prev ] ) sum ++ ; for ( int v : adj [ u ] ) if ( v != prev ) dfs ( u , v ) ; }
(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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (update_expression (identifier)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))))))