Modify an array by switching the position of two elements
@method  fnArraySwitch
@param   array aArray Array to consider, will be modified by reference (i.e. no return)
@param   int iFrom From point
@param   int iTo Insert point
@returns void
510293
function fnArraySwitch( aArray, iFrom, iTo )
{
	var mStore = aArray.splice( iFrom, 1 )[0];
	aArray.splice( iTo, 0, mStore );
}
76023
public static <T extends Comparable<? super T>> void insertionSort( T[] arr )
    {
        int j;
        for ( int i = 1; i < arr.length; i++ ) {
            T tmp = arr[i];
            for ( j = i; j > 0 && tmp.compareTo(arr[j-1]) < 0; j--) {
                arr[j] = arr[j-1];
            }
            
            if ( j < i ) arr[j] = tmp; 
        }
    }
280436
function swapEle(e1, e2) {
    var n = e1.next(),
        p = e2.prev();
    e2.insertBefore(n);
    e1.insertAfter(p);
}
788184
public void setRow(int i, double[] array, int offset)
    {
        int n = cols;
        for (int j=0;j<n;j++)
        {
            set(i, j, array[j+offset]);
        }
    }
1124039
public void setTo( int[] array , int offset , int length ) {
		resize(length);
		System.arraycopy(array,offset,data,0,length);
	}
72379
function swap(array, i, j) {
    var temp = array[i];
    array[i] = array[j];
    array[j] = temp;
  }
1200336
public static void swap(float[] floatArray, int index1, int index2) {
        TrivialSwap.swap(floatArray, index1, floatArray, index2);
    }
824711
private static void insertionSort(double[] keys, int[] vals, final int start, final int end) {
    // Classic insertion sort.
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start; j--) {
        if(keys[j] >= keys[j - 1]) {
          break;
        }
        swap(keys, vals, j, j - 1);
      }
    }
  }
753677
private static void insertionSort(ArrayModifiableDBIDs data, Comparator<? super DBIDRef> comparator, int start, int end, DBIDArrayIter iter1, DBIDArrayIter iter2) {
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start; j--) {
        if(comparator.compare(iter1.seek(j - 1), iter2.seek(j)) <= 0) {
          break;
        }
        data.swap(j, j - 1);
      }
    }
  }
690117
private void swap(int[] a, int[] indexes, int i, int j) {
        int swap = indexes[i];
        indexes[i] = indexes[j];
        indexes[j] = swap;
    }
1367503
public void swap(int i, int j) {
        Instance in = instances.get(i);
        instances.set(i, instances.get(j));
        instances.set(j, in);
    }
75056
private void swap(int i, int j, int[] sbox) {
		int temp = sbox[i];
		sbox[i] = sbox[j];
		sbox[j] = temp;
	}
1073464
public static void sortArray(int[] array) {

        boolean swapped;

        do {
            swapped = false;

            for (int i = 0; i < array.length - 1; i++) {
                if (array[i] > array[i + 1]) {
                    int temp = array[i + 1];

                    array[i + 1] = array[i];
                    array[i]     = temp;
                    swapped      = true;
                }
            }
        } while (swapped);
    }
256072
private static void insertionSort(double[] data, int start, int end) {
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start && data[j - 1] > data[j]; j--) {
        swap(data, j, j - 1);
      }
    }
  }
1034671
public static void swap(long[] longArray, int index1, int index2) {
        XORSwap.swap(longArray, index1, longArray, index2);
    }
695101
public void swapElements(int i, int j) {
        if (i != j) {
            double s = get(i);
            set(i, get(j));
            set(j, s);
        }
    }
136209
public static void swap(char[] charArray, int index1, int index2) {
        XORSwap.swap(charArray, index1, charArray, index2);
    }