随笔分类 - 数据结构
摘要:class Solution { int[] pa; int[] pb; public int find(int[] p, int x) { if(p[x] != x) p[x] = find(p,p[x]); return p[x]; } public int maxNumEdgesToRemov
阅读全文
摘要:方法一:树状数组 class NumArray { int[] nums; int[] bitArr; int n; public NumArray(int[] nums) { n = nums.length; this.nums = nums; bitArr = new int[n+1]; for
阅读全文

浙公网安备 33010602011771号