![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法集锦
zzzz_123123
这个作者很懒,什么都没留下…
展开
-
Leetcode 寻找消失的数,寻找重复数汇总
442.Find All Duplicates in an Array public class Solution {//如果数组里有负数的话不可以用这种方法,只能用交换 // some elements appear twice and others appear once. 这句话是关键 public List<Integer> findDuplicates...原创 2020-03-07 18:09:18 · 167 阅读 · 0 评论 -
快速排序、堆排序、归并排序 的java 代码
1. 快速排序 public class quick_sort { public int partition(int[]nums, int begin, int end){ int val = nums[begin]; int low = begin; int high = end; while(low < high){ while(low < high...原创 2020-03-05 23:31:52 · 176 阅读 · 0 评论