Swaps two entries of the given int array.

@param arr array
@param a   first position
@param b   second position
504745
private static void swap(final int[] arr, final int a, final int b) {
        final int c = arr[a];
        arr[a] = arr[b];
        arr[b] = c;
    }
636040
public static void swap(short[] shortArray, int index1, int index2) {
        XORSwap.swap(shortArray, index1, shortArray, index2);
    }
1034671
public static void swap(long[] longArray, int index1, int index2) {
        XORSwap.swap(longArray, index1, longArray, index2);
    }
72379
function swap(array, i, j) {
    var temp = array[i];
    array[i] = array[j];
    array[j] = temp;
  }
934144
public static <T extends Comparable<? super T>> 
    void insertionSort( T[] arr, int start, int end )
    {
        int i;
        for ( int j = start + 1; j <= end; j++ ) {
            T tmp = arr[j];
            for ( i = j; i > start && tmp.compareTo( arr[i - 1] ) < 0; i-- ) {
                arr[ i ] = arr[ i - 1 ];
            }
            if ( i < j ) arr[ i ] = tmp;
        }
    }
504933
public static void swap(short[] shortArray, int index1, int index2) {
        TrivialSwap.swap(shortArray, index1, shortArray, index2);
    }
1225207
public static void shuffle(final int[] arr, final Random rng) {
    // Fisher-Yates shuffle
    for (int i = arr.length; i > 1; i--) {
      // swap i-1 and a random spot
      final int a = i - 1;
      final int b = rng.nextInt(i);

      final int tmp = arr[b];
      arr[b] = arr[a];
      arr[a] = tmp;
    }
  }
1002839
public static void shuffle(int[] intArray) {
		int swapPlace = -1;

		for(int i = 0; i < intArray.length; i++) {
			swapPlace = (int) (Math.random() * (intArray.length - 1 ));
			XORSwap.swap(intArray, i, swapPlace);
		}
	}
1075390
private static void insertionSort(ModifiableDoubleDBIDList data, int start, int end, DoubleDBIDListIter iter1, DoubleDBIDListIter iter2) {
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start; j--) {
        if(iter1.seek(j - 1).doubleValue() < iter2.seek(j).doubleValue()) {
          break;
        }
        data.swap(j, j - 1);
      }
    }
  }
951330
public static <E> void swap(E[] array, int index1, int index2) {
        TrivialSwap.swap(array, index1, array, index2);
    }
544782
private function swap(int $a, int $b)
    {
        $temp           = $this->heap[$a];
        $this->heap[$a] = $this->heap[$b];
        $this->heap[$b] = $temp;
    }
1278337
private void swapVals(int e, int f, int[] vals) {
        int vals_e = vals[e];
        vals[e] = vals[f];
        vals[f] = vals_e;
    }
1260137
public static void swap(int[] intArray, int index1, int index2) {
        XORSwap.swap(intArray, index1, intArray, index2);
    }
856382
private static void swap(double[] keys, int[] vals, int j, int i) {
    double td = keys[j];
    keys[j] = keys[i];
    keys[i] = td;
    int ti = vals[j];
    vals[j] = vals[i];
    vals[i] = ti;
  }
881224
public static void swap(double[] doubleArray, int index1, int index2) {
        TrivialSwap.swap(doubleArray, index1, doubleArray, index2);
    }
836136
void swap(int element1, int element2) {
		int ar1[] = m_buffer[element1 >> m_blockPower];
		int ar2[] = m_buffer[element2 >> m_blockPower];
		int ind1 = element1 & m_blockMask;
		int ind2 = element2 & m_blockMask;
		for (int i = 0; i < m_stride; i++) {
			int tmp = ar1[ind1 + i];
			ar1[ind1 + i] = ar2[ind2 + i];
			ar2[ind2 + i] = tmp;
		}
	}
578951
function swapArrayElements(items, indexFrom, indexTo) {
  var item = items[indexTo];
  items[indexTo] = items[indexFrom];
  items[indexFrom] = item;
  return items;
}