static void printReverse ( Node head ) {
  Stack < Node > stk = new Stack < Node > ( ) ;
  Node ptr = head ;
  while ( ptr != null ) {
    stk . push ( ptr ) ;
    ptr = ptr . next ;
  }
  while ( stk . size ( ) > 0 ) {
    System . out . print ( stk . peek ( ) . data + " " ) ;
    stk . pop ( ) ;
  }
  System . out . println ( "\n" ) ;
}

static void printReverse ( Node head ) { Stack < Node > stk = new Stack < Node > ( ) ; Node ptr = head ; while ( ptr != null ) { stk . push ( ptr ) ; ptr = ptr . next ; } while ( stk . size ( ) > 0 ) { System . out . print ( stk . peek ( ) . data + " ▁ " ) ; stk . pop ( ) ; } System . out . println ( " \n " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))) (while_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) field: (identifier)) right: (string_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))