- 博客(4)
- 收藏
- 关注
原创 Best Time to Buy and Sell Stock IV(DP解法,o(kn)时间,o(k)空间)
Leetcode 上Best Time to Buy and Sell Stock IV解题思路:此解法主要参考http://blog.csdn.net/linhuanmars/article/details/23236995#cpp上的思路, 但是博主的递归式不是很好理解,因此加上自己的理解,希望对后来者有所帮助, 第一次这么认真的写博客,如发现问题或者理解错误,欢迎批评指正,谢谢!DP解法:
2016-01-06 15:52:00 225
原创 Search Insert Position
题目来源:https://leetcode.com/problems/search-insert-position/ 题目描述:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were
2015-11-18 14:44:23 122
原创 Search for a Range
题目来源:https://leetcode.com/problems/search-for-a-range/class Solution { public: // 记住最后递归的left 和right 能够减少寻找左边界和右边界的时间。 int binarySearch(vector<int> &nums, int left, int right, int target) {
2015-11-18 14:19:45 116
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人