public static void swap(int[] numbers, int i, int j) {
int temp = numbers[i];
numbers[i] = numbers[j];
numbers[j] = temp;
}
public static void swap1(int[] numbers, int i, int j) {
numbers[i] = numbers[i] + numbers[j];
numbers[j] = numbers[i] - numbers[j];
numbers[i] = numbers[i] - numbers[j];
}
public static void swap2(int[] numbers, int i, int j) {
numbers[i] = numbers[i] ^ numbers[j];
numbers[j] = numbers[i] ^ numbers[j];
numbers[i] = numbers[i] ^ numbers[j];
}
网友评论