static Node deleteEvenNodes ( Node head ) {
  Node ptr = head ;
  Node next ;
  do {
    if ( ptr . data % 2 == 0 ) deleteNode ( head , ptr ) ;
    next = ptr . next ;
    ptr = next ;
  }
  while ( ptr != head ) ;
  return head ;
}

static Node deleteEvenNodes ( Node head ) { Node ptr = head ; Node next ; do { if ( ptr . data % 2 == 0 ) deleteNode ( head , ptr ) ; next = ptr . next ; ptr = next ; } while ( ptr != head ) ; return head ; }
(method_declaration (modifiers) type: (type_identifier) 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) value: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (do_statement body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (return_statement (identifier))))