![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
fightSA
这个作者很懒,什么都没留下…
展开
-
LintCode Best Time to Buy and Sell Stock
149. Best Time to Buy and Sell Stock 方法一:时间复杂度 两次for循环,第一层循环寻找买入价,第二层循环寻找卖出价; public class Solution { /** * @param prices: Given an integer array * @return: Maximum profit */ ...原创 2018-12-04 00:58:35 · 133 阅读 · 0 评论 -
LintCode Remove Linked List Elements
452. Remove Linked List Elements ListNode类 public class ListNode { int val; ListNode next; public ListNode(int val) { this.val = val; this.next = null; } } 方法一:不使用虚拟头结点 public class ...原创 2018-12-16 09:46:23 · 132 阅读 · 0 评论 -
快速排序及其优化(java版)
快速排序及其优化[一般的快速排序](http://developer.51cto.com/art/201403/430986.htm)随机化快速排序三路快速排序 一般的快速排序 假设我们现在对“6 1 2 7 9 3 4 5 10 8”这个10个数进行排序。首先以第一个数6作为基准数吧。接下来,需要将这个序列中所有比基准数大的数放在6的右边,比基准数小的数放在6的左边,类似下面这种排...转载 2019-01-11 14:04:59 · 438 阅读 · 0 评论