public static boolean dfs ( int root , int prnt , int ht ) {
  boolean flg = false ;
  boolean haschild = false ;
  for ( int i = 0 ;
  i < adjacencyList [ root ] . size ( ) ;
  i ++ ) {
    if ( adjacencyList [ root ] . get ( i ) == prnt ) continue ;
    haschild = true ;
    flg = flg || dfs ( adjacencyList [ root ] . get ( i ) , root , ht + 1 ) ;
  }
  if ( ! haschild ) flg = flg || ( ht % 2 == 1 ) ;
  return flg ;
}

public static boolean dfs ( int root , int prnt , int ht ) { boolean flg = false ; boolean haschild = false ; for ( int i = 0 ; i < adjacencyList [ root ] . size ( ) ; i ++ ) { if ( adjacencyList [ root ] . get ( i ) == prnt ) continue ; haschild = true ; flg = flg || dfs ( adjacencyList [ root ] . get ( i ) , root , ht + 1 ) ; } if ( ! haschild ) flg = flg || ( ht % 2 == 1 ) ; return flg ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))) right: (identifier))) consequence: (continue_statement)) (expression_statement (assignment_expression left: (identifier) right: (true))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))))))) (return_statement (identifier))))