txk(bushiPublished at 2 years ago来个抖机灵的数组元素交换算法看看就行啦,听课学到的,使用的时候注意安全哈 public static void swap(int[] arr, int i, int j) { arr[i] = arr[i] ^ arr[j]; arr[j] = arr[i] ^ arr[j]; arr[i] = arr[i] ^ arr[j]; } 50 views33Share