18 lines
409 B
Java
18 lines
409 B
Java
package com.fabiosalvini.utils;
|
|
|
|
public class ArrayUtils {
|
|
|
|
/**
|
|
* In-place swap of two array elements.
|
|
*
|
|
* @param array the input array.
|
|
* @param i index of the first element.
|
|
* @param j index of the second element.
|
|
*/
|
|
public static void swap(long[] array, int i, int j) {
|
|
long tmp = array[i];
|
|
array[i] = array[j];
|
|
array[j] = tmp;
|
|
}
|
|
}
|