上一页 1 2 3 4 5 6 7 ··· 41 下一页
摘要: 求总和最大的子数组。 动态规划dp。 Suppose we’ve solved the problem for A[1 .. i - 1]; how can we extend that to A[1 .. i]? The maximum sum in the first I el... 阅读全文
posted @ 2017-03-03 19:59 StevenLuke 阅读(101) 评论(0) 推荐(0) 编辑
摘要: //283public class Solution { public void moveZeroes(int[] nums) { int flag = 0; for(int i=0; i map = new HashMap(); f... 阅读全文
posted @ 2017-02-26 22:04 StevenLuke 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 例如414,用java做的话好多坑,以后就用java刷leetcode了。//414public class Solution { public int thirdMax(int[] nums) { Integer max1 = null; //不能使用Inte... 阅读全文
posted @ 2017-02-25 14:03 StevenLuke 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 今天发现leetcode比别的都好。。。因为面试面到121题,我愚笨的脑袋用了两个for循环,只用一个for循环我是想不出的。 121:class Solution {public: int maxProfit(vector& prices) { size_t ... 阅读全文
posted @ 2017-02-22 19:20 StevenLuke 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 一开始我用两个循环,如果只用一个循环的话:int maxProfit(vector& prices) { size_t size = prices.size(); if (size <= 1) return 0; int min = INT... 阅读全文
posted @ 2017-02-22 18:28 StevenLuke 阅读(230) 评论(0) 推荐(0) 编辑
摘要: concurrentHashMap 线程池的几种常见的创建的方式 阅读全文
posted @ 2017-02-17 19:22 StevenLuke 阅读(70) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/u014033756/article/details/505998791、HashSet底层是采用HashMap实现的。HashSet 的实现比较简单,HashSet 的绝大部分方法都是通过调用 HashMap 的方法来实现的,因此 Has... 阅读全文
posted @ 2017-02-17 19:21 StevenLuke 阅读(330) 评论(0) 推荐(0) 编辑
摘要: refer to :http://www.cnblogs.com/inspurhaitian/p/4647485.html我是一名java开发人员,hibernate以及mybatis都有过学习,在java面试中也被提及问道过,在项目实践中也应用过,现在对hibernate和myb... 阅读全文
posted @ 2017-02-17 17:32 StevenLuke 阅读(113) 评论(0) 推荐(0) 编辑
摘要: poj3176//648k, 32ms#include using namespace std;const int MAX_N = 355;int way[MAX_N][MAX_N];int n;int max(int a, int b) { return a>b ? a :... 阅读全文
posted @ 2017-02-17 13:18 StevenLuke 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 对牛按照milk的开始时间排序。 对优先队列里牛的milk的结束时间排序,结束时间最早的作为que.top()和牛i做对比,如果牛i的开始时间大于(因为文中说include A和B,所以不能取等号。)que.top()的结束时间,那么将该牛的牛栏(stall)设为与que.top(... 阅读全文
posted @ 2017-02-14 15:33 StevenLuke 阅读(78) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 41 下一页