摘要: public static void charuSort(int arr[]){ if(arr == null || arr.length < 2) return ; int N = arr.length; /* * 1 ~ N - 1 * 2 ~ N - 1 * 3 ~ N - 1 * 4 ~ N 阅读全文
posted @ 2021-11-05 16:50 黯渊 阅读(20) 评论(0) 推荐(0) 编辑
摘要: @Test public void yier(){ int []arr = {1,2,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9}; //假设这两个数设为 a,b int eor = 0; for(int i : arr) eor ^= i; //此时eor = a ^ b in 阅读全文
posted @ 2021-11-05 16:07 黯渊 阅读(60) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args) { // 创建一个数组,里面有两个 1,四个 2,三个 3 int arr[] = {1,2,3,2,3,2,3,2,1}; System.out.println(yi(arr)); 阅读全文
posted @ 2021-11-05 14:58 黯渊 阅读(84) 评论(0) 推荐(0) 编辑