static double getMaxMedian ( int [ ] arr , int n , int k ) {
  int size = n + k ;
  Arrays . sort ( arr ) ;
  if ( size % 2 == 0 ) {
    double median = ( double ) ( arr [ ( size / 2 ) - 1 ] + arr [ size / 2 ] ) / 2 ;
    return median ;
  }
  double median1 = arr [ size / 2 ] ;
  return median1 ;
}

static double getMaxMedian ( int [ ] arr , int n , int k ) { int size = n + k ; Arrays . sort ( arr ) ; if ( size % 2 == 0 ) { double median = ( double ) ( arr [ ( size / 2 ) - 1 ] + arr [ size / 2 ] ) / 2 ; return median ; } double median1 = arr [ size / 2 ] ; return median1 ; }
(method_declaration (modifiers) type: (floating_point_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: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) right: (decimal_integer_literal)))) (return_statement (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))