随笔分类 -  数据结构

摘要: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 阅读全文
posted @ 2020-09-08 10:01 Sexyomaru 阅读(238) 评论(0) 推荐(0)
摘要:方法一:树状数组 class NumArray { int[] nums; int[] bitArr; int n; public NumArray(int[] nums) { n = nums.length; this.nums = nums; bitArr = new int[n+1]; for 阅读全文
posted @ 2020-09-01 15:36 Sexyomaru 阅读(164) 评论(0) 推荐(0)