static void traverse ( Node head ) {
  Node p ;
  if ( head == null ) {
    System . out . print ( "List is empty." ) ;
    return ;
  }
  p = head ;
  do {
    System . out . print ( p . data + " " ) ;
    p = p . next ;
  }
  while ( p != head ) ;
}

static void traverse ( Node head ) { Node p ; if ( head == null ) { System . out . print ( " List ▁ is ▁ empty . " ) ; return ; } p = head ; do { System . out . print ( p . data + " ▁ " ) ; p = p . next ; } while ( p != head ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (string_literal))))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))