private static int maxsort ( int [ ] arr , int i , int j ) {
  int count = 1 ;
  for ( int k = i ;
  k <= j ;
  ) {
    if ( k + 1 <= j && arr [ k ] <= arr [ k + 1 ] ) {
      k ++ ;
      count ++ ;
    }
    else {
      break ;
    }
  }
  if ( count == j - i + 1 ) return count ;
  else return Math . max ( maxsort ( arr , i + ( j - i + 1 ) / 2 , j ) , maxsort ( arr , i , j - ( j - i + 1 ) / 2 ) ) ;
}

private static int maxsort ( int [ ] arr , int i , int j ) { int count = 1 ; for ( int k = i ; k <= j ; ) { if ( k + 1 <= j && arr [ k ] <= arr [ k + 1 ] ) { k ++ ; count ++ ; } else { break ; } } if ( count == j - i + 1 ) return count ; else return Math . max ( maxsort ( arr , i + ( j - i + 1 ) / 2 , j ) , maxsort ( arr , i , j - ( j - i + 1 ) / 2 ) ) ; }
(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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) 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)))))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier)))) alternative: (block (break_statement))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) consequence: (return_statement (identifier)) alternative: (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (decimal_integer_literal))) (identifier))) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))))))))