List of utility methods to do Array Swap
void | swap(Object aobj[], int i, int j, int k) swap for (int l = 0; l < i; l++) { Object obj = aobj[j + l]; aobj[j + l] = aobj[k + l]; aobj[k + l] = obj; |
void | swap(Object[] arr, int a, int b) Swaps arr[a] with arr[b] in the specified array. Object tempObj = arr[a]; arr[a] = arr[b]; arr[b] = tempObj; |
void | swap(Object[] arr, int i, int j) Swaps the two specified elements in the specified array. Object tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; |
void | swap(Object[] arr, int i, int j) Swap two elements of an Array. Object t = arr[i]; arr[i] = arr[j]; arr[j] = t; |
void | swap(Object[] array) Reverse the elements in the array. int start = 0; int end = array.length - 1; while (start < end) { Object temp = array[start]; array[start++] = array[end]; array[end--] = temp; |
void | swap(Object[] array, int a, int b) swap Object aux = array[a]; array[a] = array[b]; array[b] = aux; |
void | swap(Object[] x, int a, int b) Swaps x[a] with x[b]. Object t = x[a]; x[a] = x[b]; x[b] = t; |
void | swap(short x[], int a, int b) Swaps x[a] with x[b]. short t = x[a];
x[a] = x[b];
x[b] = t;
|
void | swap(short x[], int[] y, int a, int b) Swaps x[a] with x[b]. short t = x[a]; x[a] = x[b]; x[b] = t; int o = y[a]; y[a] = y[b]; y[b] = o; |
void | swap(short x[], T[] a2, int a, int b) Swaps x[a] with x[b]. short t = x[a];
x[a] = x[b];
x[b] = t;
T t2 = a2[a];
a2[a] = a2[b];
a2[b] = t2;
|