static boolean checkUnimodal ( int arr [ ] , int n ) {
  int i = 1 ;
  while ( i < n && arr [ i ] > arr [ i - 1 ] ) ++ i ;
  while ( i < n && arr [ i ] == arr [ i - 1 ] ) ++ i ;
  while ( i < n && arr [ i ] < arr [ i - 1 ] ) ++ i ;
  return ( i == n ) ;
}

static boolean checkUnimodal ( int arr [ ] , int n ) { int i = 1 ; while ( i < n && arr [ i ] > arr [ i - 1 ] ) ++ i ; while ( i < n && arr [ i ] == arr [ i - 1 ] ) ++ i ; while ( i < n && arr [ i ] < arr [ i - 1 ] ) ++ i ; return ( i == n ) ; }
(method_declaration (modifiers) type: (boolean_type) 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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) body: (expression_statement (update_expression (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) body: (expression_statement (update_expression (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) body: (expression_statement (update_expression (identifier)))) (return_statement (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))