Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element.
分类:
其他好文 时间:
2016-03-16 16:57:10
阅读次数:
182
LintCode: Search in Rotated Sorted Array
分类:
其他好文 时间:
2016-03-13 06:08:47
阅读次数:
145
LintCode : Find Minimum in Rotated Sorted Array
分类:
其他好文 时间:
2016-03-13 00:25:32
阅读次数:
198
看到题目写的hard,感觉走一边数组就可以了嘛 1 class Solution { 2 public: 3 int search(vector<int>& nums, int target) { 4 for(int i=0;i<nums.size();i++) 5 { 6 if(nums[i]==
分类:
其他好文 时间:
2016-03-12 13:14:38
阅读次数:
124
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va
分类:
其他好文 时间:
2016-03-12 01:20:02
阅读次数:
170
题目:
Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:
Try to come up as many solutions as you can,...
分类:
其他好文 时间:
2016-03-05 23:51:31
阅读次数:
310
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va
分类:
其他好文 时间:
2016-03-05 16:11:18
阅读次数:
171
Given a rotated sorted array, recover it to sorted array in-place. [4, 5, 1, 2, 3] -> [1, 2, 3, 4, 5] 方法挺诡异的,记住就好: 找到分界点,把左半边反转,把右半边反转,这时候整个数组就是从大到小排列
分类:
其他好文 时间:
2016-03-05 08:00:10
阅读次数:
159
原题链接在这里:https://leetcode.com/problems/strobogrammatic-number-ii/ 题目: A strobogrammatic number is a number that looks the same when rotated 180 degrees
分类:
其他好文 时间:
2016-03-05 06:53:12
阅读次数:
587
原题链接在这里:https://leetcode.com/problems/strobogrammatic-number/ 题目: A strobogrammatic number is a number that looks the same when rotated 180 degrees (l
分类:
其他好文 时间:
2016-03-05 06:49:04
阅读次数:
170