public static void main ( String [ ] args ) {
  LinkedList list = new LinkedList ( ) ;
  for ( int i = 20 ;
  i > 0 ;
  i -- ) {
    list . push ( i ) ;
  }
  System . out . println ( "Given Linked List :" ) ;
  list . printList ( head ) ;
  head = list . kAltReverse ( head , 3 ) ;
  System . out . println ( "" ) ;
  System . out . println ( "Modified Linked List :" ) ;
  list . printList ( head ) ;
}

public static void main ( String [ ] args ) { LinkedList list = new LinkedList ( ) ; for ( int i = 20 ; i > 0 ; i -- ) { list . push ( i ) ; } System . out . println ( " Given ▁ Linked ▁ List ▁ : " ) ; list . printList ( head ) ; head = list . kAltReverse ( head , 3 ) ; System . out . println ( " " ) ; System . out . println ( " Modified ▁ Linked ▁ List ▁ : " ) ; list . printList ( head ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))