private void merge(int middle){
  if (array[middle - 1] < array[middle]) {
    return;
  }
  int[] copy=new int[high - low];
  System.arraycopy(array,low,copy,0,copy.length);
  int copyLow=0;
  int copyHigh=high - low;
  int copyMiddle=middle - low;
  for (int i=low, p=copyLow, q=copyMiddle; i < high; i++) {
    if (q >= copyHigh || (p < copyMiddle && copy[p] < copy[q])) {
      array[i]=copy[p++];
    }
 else {
      array[i]=copy[q++];
    }
  }
}

private void merge ( int middle ) { if ( array [ middle - 1 ] < array [ middle ] ) { return ; } int [ ] copy = new int [ high - low ] ; System . arraycopy ( array , low , copy , 0 , copy . length ) ; int copyLow = 0 ; int copyHigh = high - low ; int copyMiddle = middle - low ; for ( int i = low , p = copyLow , q = copyMiddle ; i < high ; i ++ ) { if ( q >= copyHigh || ( p < copyMiddle && copy [ p ] < copy [ q ] ) ) { array [ i ] = copy [ p ++ ] ; } else { array [ i ] = copy [ q ++ ] ; } } }
merges the two sorted arrays this . low , middle - 1 and middle , this . high - 1
