static int maxLenBitonic ( int [ ] A , int n ) {
  if ( n == 0 ) return 0 ;
  int maxLen = 1 ;
  int start = 0 ;
  int nextStart = 0 ;
  int j = 0 ;
  while ( j < n - 1 ) {
    while ( j < n - 1 && A [ j ] <= A [ j + 1 ] ) j ++ ;
    while ( j < n - 1 && A [ j ] >= A [ j + 1 ] ) {
      if ( j < n - 1 && A [ j ] > A [ j + 1 ] ) nextStart = j + 1 ;
      j ++ ;
    }
    maxLen = Math . max ( maxLen , j - ( start - 1 ) ) ;
    start = nextStart ;
  }
  return maxLen ;
}

static int maxLenBitonic ( int [ ] A , int n ) { if ( n == 0 ) return 0 ; int maxLen = 1 ; int start = 0 ; int nextStart = 0 ; int j = 0 ; while ( j < n - 1 ) { while ( j < n - 1 && A [ j ] <= A [ j + 1 ] ) j ++ ; while ( j < n - 1 && A [ j ] >= A [ j + 1 ] ) { if ( j < n - 1 && A [ j ] > A [ j + 1 ] ) nextStart = j + 1 ; j ++ ; } maxLen = Math . max ( maxLen , j - ( start - 1 ) ) ; start = nextStart ; } return maxLen ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_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) value: (decimal_integer_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) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) body: (block (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) 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: (binary_expression left: (identifier) right: (decimal_integer_literal))) 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: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (return_statement (identifier))))