public static void main ( String args [ ] ) {
  int N = 6 ;
  for ( int i = 0 ;
  i <= N ;
  i ++ ) adjacency . add ( new Vector < Integer > ( ) ) ;
  insert ( 1 , 2 ) ;
  insert ( 1 , 3 ) ;
  insert ( 3 , 4 ) ;
  insert ( 3 , 5 ) ;
  insert ( 3 , 6 ) ;
  int leaf [ ] = new int [ N + 1 ] ;
  int vis [ ] = new int [ N + 1 ] ;
  dfs ( 1 , leaf , vis ) ;
  printLeaf ( N , leaf ) ;
}

public static void main ( String args [ ] ) { int N = 6 ; for ( int i = 0 ; i <= N ; i ++ ) adjacency . add ( new Vector < Integer > ( ) ) ; insert ( 1 , 2 ) ; insert ( 1 , 3 ) ; insert ( 3 , 4 ) ; insert ( 3 , 5 ) ; insert ( 3 , 6 ) ; int leaf [ ] = new int [ N + 1 ] ; int vis [ ] = new int [ N + 1 ] ; dfs ( 1 , leaf , vis ) ; printLeaf ( N , leaf ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))))