static Pair getMinMax ( int arr [ ] , int n ) {
  Pair minmax = new Pair ( ) ;
  int i ;
  if ( n % 2 == 0 ) {
    if ( arr [ 0 ] > arr [ 1 ] ) {
      minmax . max = arr [ 0 ] ;
      minmax . min = arr [ 1 ] ;
    }
    else {
      minmax . min = arr [ 0 ] ;
      minmax . max = arr [ 1 ] ;
    }
    i = 2 ;
  }
  else {
    minmax . min = arr [ 0 ] ;
    minmax . max = arr [ 0 ] ;
    i = 1 ;
  }
  while ( i < n - 1 ) {
    if ( arr [ i ] > arr [ i + 1 ] ) {
      if ( arr [ i ] > minmax . max ) {
        minmax . max = arr [ i ] ;
      }
      if ( arr [ i + 1 ] < minmax . min ) {
        minmax . min = arr [ i + 1 ] ;
      }
    }
    else {
      if ( arr [ i + 1 ] > minmax . max ) {
        minmax . max = arr [ i + 1 ] ;
      }
      if ( arr [ i ] < minmax . min ) {
        minmax . min = arr [ i ] ;
      }
    }
    i += 2 ;
  }
  return minmax ;
}

static Pair getMinMax ( int arr [ ] , int n ) { Pair minmax = new Pair ( ) ; int i ; if ( n % 2 == 0 ) { if ( arr [ 0 ] > arr [ 1 ] ) { minmax . max = arr [ 0 ] ; minmax . min = arr [ 1 ] ; } else { minmax . min = arr [ 0 ] ; minmax . max = arr [ 1 ] ; } i = 2 ; } else { minmax . min = arr [ 0 ] ; minmax . max = arr [ 0 ] ; i = 1 ; } while ( i < n - 1 ) { if ( arr [ i ] > arr [ i + 1 ] ) { if ( arr [ i ] > minmax . max ) { minmax . max = arr [ i ] ; } if ( arr [ i + 1 ] < minmax . min ) { minmax . min = arr [ i + 1 ] ; } } else { if ( arr [ i + 1 ] > minmax . max ) { minmax . max = arr [ i + 1 ] ; } if ( arr [ i ] < minmax . min ) { minmax . min = arr [ i ] ; } } i += 2 ; } return minmax ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) 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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal))))) alternative: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))