![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 95
nnzhuilian
这个作者很懒,什么都没留下…
展开
-
最长不重复子串
1.利用滑动窗口(Set)2.直接计算两重复元素间的间隔Java (Assuming ASCII 128)The previous implements all have no assumption on the charset of the string s.If we know that the charset is rather small, we can replace t...原创 2018-08-30 10:47:14 · 86 阅读 · 0 评论 -
常见的排序算法总结与实现-Java版
排序算法的时间复杂度与稳定性稳定指相同值是否会被打乱。1.关于稳定性:不稳定:快选堆希(快速排序、选择排序、堆排序、希尔排序)稳 定:插冒归计基(简单插入排序、冒泡排序、归并排序、计数排序、基数排序)2.关于移动次数和关键字顺序无关的排序顺口溜:一堆(堆排序)海龟(归并排序)选(选择排序)基(基数排序)友冒泡排序(时间:O(n2), 空间:O(1)...原创 2018-11-23 10:47:05 · 204 阅读 · 0 评论 -
股票盈利问题
笔试遇到好几次。方法一:类似于动态规划?暴力法,递归层级计算最优解public int calculate(int prices[], int s) { if (s >= prices.length) return 0; int max = 0; for (int start = s; start < p...原创 2019-04-29 15:53:48 · 245 阅读 · 0 评论