credimi-challenge-permutations/src/main/java/com/fabiosalvini/utils/ArrayUtils.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;
}
}