static void mergeTwoSortedArray ( int [ ] arr1 , int [ ] arr2 , int n , int m ) {
  int x = Math . min ( n , m ) ;
  for ( int i = 0 ;
  i < x ;
  i ++ ) {
    if ( arr1 [ n - i - 1 ] > arr2 [ i ] ) {
      int temp = arr1 [ n - i - 1 ] ;
      arr1 [ n - i - 1 ] = arr2 [ i ] ;
      arr2 [ i ] = temp ;
    }
  }
  for ( int gap = nextGap ( n ) ;
  gap > 0 ;
  gap = nextGap ( gap ) ) {
    for ( int i = 0 ;
    i + gap < n ;
    i ++ ) if ( arr1 [ i ] > arr1 [ i + gap ] ) {
      int temp = arr1 [ i ] ;
      arr1 [ i ] = arr1 [ i + gap ] ;
      arr1 [ i + gap ] = temp ;
    }
  }
  for ( int gap = nextGap ( m ) ;
  gap > 0 ;
  gap = nextGap ( gap ) ) {
    for ( int i = 0 ;
    i + gap < m ;
    i ++ ) if ( arr2 [ i ] > arr2 [ i + gap ] ) {
      int temp = arr2 [ i ] ;
      arr2 [ i ] = arr2 [ i + gap ] ;
      arr2 [ i + gap ] = temp ;
    }
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) System . out . print ( arr1 [ i ] + " " ) ;
  for ( int j = 0 ;
  j < m ;
  j ++ ) System . out . print ( arr2 [ j ] + " " ) ;
}

static void mergeTwoSortedArray ( int [ ] arr1 , int [ ] arr2 , int n , int m ) { int x = Math . min ( n , m ) ; for ( int i = 0 ; i < x ; i ++ ) { if ( arr1 [ n - i - 1 ] > arr2 [ i ] ) { int temp = arr1 [ n - i - 1 ] ; arr1 [ n - i - 1 ] = arr2 [ i ] ; arr2 [ i ] = temp ; } } for ( int gap = nextGap ( n ) ; gap > 0 ; gap = nextGap ( gap ) ) { for ( int i = 0 ; i + gap < n ; i ++ ) if ( arr1 [ i ] > arr1 [ i + gap ] ) { int temp = arr1 [ i ] ; arr1 [ i ] = arr1 [ i + gap ] ; arr1 [ i + gap ] = temp ; } } for ( int gap = nextGap ( m ) ; gap > 0 ; gap = nextGap ( gap ) ) { for ( int i = 0 ; i + gap < m ; i ++ ) if ( arr2 [ i ] > arr2 [ i + gap ] ) { int temp = arr2 [ i ] ; arr2 [ i ] = arr2 [ i + gap ] ; arr2 [ i + gap ] = temp ; } } for ( int i = 0 ; i < n ; i ++ ) System . out . print ( arr1 [ i ] + " ▁ " ) ; for ( int j = 0 ; j < m ; j ++ ) System . out . print ( arr2 [ j ] + " ▁ " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier)))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier)))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))))))))