class Solution { public int findDuplicate(int[] nums) { if(nums == null || nums.length<=1) return -1; int fast = 0, slow = 0; while (true){ fast = num Read More
posted @ 2021-08-30 19:06 K峰 Views(47) Comments(0) Diggs(0)
索引的实现原理 InnoDB也使用B+Tree作为索引结构。InnoDB支持聚簇索引,聚簇索引就是表,所以InnoDB的数据文件本身就是索引文件。 B+Tree 的每个叶子节点都包含了主键值、事务ID、用于事务和MVCC的回滚指针以及所有的剩余列。非叶子节点只需要存储索引信息 InnoDB的二级索引 Read More
posted @ 2021-08-30 17:29 K峰 Views(99) Comments(0) Diggs(0)
插入算法 public void insertionSort(int[] array){ for(int i = 1;i<array.length;i++){ int cur = array[i]; int insertionIndex = i-1; while(insertionIndex >= Read More
posted @ 2021-08-30 16:53 K峰 Views(46) Comments(0) Diggs(0)
设计的知识点 a|=b的意义是a = a | b 将int数值,作为二进制进行比较,各位不同时返回1 int a = 5; // 0000 0101 int b = 3; // 0000 0011 a |= b; // 0000 0011 &=与|比较方式相同,逻辑相反 两位不同时直接返回0 int Read More
posted @ 2021-08-30 15:29 K峰 Views(51) Comments(0) Diggs(0)