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

static Pair getMinMax ( int arr [ ] , int n ) { Pair minmax = new Pair ( ) ; int i ; if ( n == 1 ) { minmax . max = arr [ 0 ] ; minmax . min = arr [ 0 ] ; return minmax ; } if ( arr [ 0 ] > arr [ 1 ] ) { minmax . max = arr [ 0 ] ; minmax . min = arr [ 1 ] ; } else { minmax . max = arr [ 1 ] ; minmax . min = arr [ 0 ] ; } for ( i = 2 ; i < n ; i ++ ) { if ( arr [ i ] > minmax . max ) { minmax . max = arr [ i ] ; } else if ( arr [ i ] < minmax . min ) { minmax . min = arr [ i ] ; } } 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: (identifier) right: (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)))) (return_statement (identifier)))) (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)))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (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))))) alternative: (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))))))))) (return_statement (identifier))))