static void replaceNodes ( Node head ) {
  Node p = head ;
  Node x = null ;
  int count = 0 ;
  int i ;
  while ( p != null ) {
    count = 0 ;
    i = 0 ;
    x = p ;
    while ( x != null ) {
      if ( x . data > p . data ) count ++ ;
      x = x . next ;
    }
    p . data = count ;
    p = p . next ;
  }
}

static void replaceNodes ( Node head ) { Node p = head ; Node x = null ; int count = 0 ; int i ; while ( p != null ) { count = 0 ; i = 0 ; x = p ; while ( x != null ) { if ( x . data > p . data ) count ++ ; x = x . next ; } p . data = count ; p = p . next ; } }
(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) value: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (null_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) consequence: (expression_statement (update_expression (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))))))