棋子

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

02 2016 档案

求全排列(数组有重复元素和数组无重复元素) 回溯 递归
摘要:http://www.cnblogs.com/TenosDoIt/p/3662644.html 无重复元素 http://blog.csdn.net/havenoidea/article/details/12838479 有重复元素 阅读全文

posted @ 2016-02-23 19:29 鼬与轮回 阅读(392) 评论(0) 推荐(0) 编辑

Count and Say leetcode
摘要:题目链接 The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is rea 阅读全文

posted @ 2016-02-23 01:06 鼬与轮回 阅读(200) 评论(0) 推荐(0) 编辑

Find Minimum in Rotated Sorted Array II leetcode
摘要:题目链接 这个博客的算法思想简单好! 还是贴上自己的蹩脚代码吧!! 1 class Solution { 2 public: 3 int findMin(vector<int>& nums) { 4 if(nums.empty()) 5 return -1; 6 int begin=0,end=nu 阅读全文

posted @ 2016-02-10 11:11 鼬与轮回 阅读(183) 评论(0) 推荐(0) 编辑

Find Minimum in Rotated Sorted Array leetcode
摘要:原题链接 直接贴代码,这道题是 search in rotated sorted array leetcode 的前面部分! 1 class Solution { 2 public: 3 int findMin(vector<int>& nums) { 4 if (nums.empty()) 5 r 阅读全文

posted @ 2016-02-10 10:18 鼬与轮回 阅读(151) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array II leetcode
摘要:原题链接,点我 该题解题参考博客 和Search in Rotated Sorted Array唯一的区别是这道题目中元素会有重复的情况出现。不过正是因为这个条件的出现,出现了比较复杂的case,甚至影响到了算法的时间复杂度。原来我们是依靠中间和边缘元素的大小关系,来判断哪一半是不受rotate影响 阅读全文

posted @ 2016-02-09 23:45 鼬与轮回 阅读(180) 评论(0) 推荐(0) 编辑

search in rotated sorted array leetcode
摘要:原题链接 题意:给你一个目标值,或者返回其在数组中的下标位置,或者返回-1(表示不存在,查找失败)。 例如 0 1 2 4 5 6 7 可能成为 4 5 6 7 0 1 2. 思路分析: 用二分搜索来找到转折点,也就是最小数的位置。对二分搜索要稍作修改,当a[left]<=a[mid],可以肯定a[ 阅读全文

posted @ 2016-02-09 13:33 鼬与轮回 阅读(179) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示