码迷,mamicode.com
首页 >  
搜索关键字:rotated    ( 804个结果
leetcode Search in Rotated Sorted Array python
#Suppose a sorted array is rotated at some pivot unknown to you beforehand.#(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).#You are given a target valu...
分类:编程语言   时间:2015-12-19 16:33:54    阅读次数:236
189. Rotate Array(Array)
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:...
分类:其他好文   时间:2015-12-16 12:06:56    阅读次数:232
[LeetCode]111. Find Minimum in Rotated Sorted Array II旋转数组最小值II
Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort...
分类:编程语言   时间:2015-12-15 12:23:59    阅读次数:206
LeetCode - Search in Rotated Sorted Array II
题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a functi...
分类:其他好文   时间:2015-12-06 11:19:26    阅读次数:124
248. Strobogrammatic Number III
题目:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to count the total strob...
分类:其他好文   时间:2015-12-01 07:11:41    阅读次数:634
[LeetCode]题解(python):033-Search in Rotated Sorted Array
题目来源https://leetcode.com/problems/search-in-rotated-sorted-array/Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2...
分类:编程语言   时间:2015-11-29 12:08:52    阅读次数:156
[LeetCode]Search in Rotated Sorted Array
public class Solution { public int search(int[] nums, int target) { int left = 0; int right = nums.length - 1; int length = nu...
分类:其他好文   时间:2015-11-27 10:45:14    阅读次数:110
LeetCode 33 Search in Rotated Sorted Array(在旋转排序数组中搜索)(*)
翻译假定一个数组在一个我们预先不知道的轴点旋转。例如,0 1 2 4 5 6 7可能会变为4 5 6 7 0 1 2。给你一个目标值去搜索,如果找到了则返回它的索引,否则返回-1。你可以假定没有重复的元素存在于数组中。原文Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4...
分类:编程语言   时间:2015-11-26 21:22:24    阅读次数:149
[lintcode easy]Recover rotated sorted array
Recover Rotated Sorted ArrayGiven a rotated sorted array, recover it to sorted array in-place.Example[4, 5, 1, 2, 3] -> [1, 2, 3, 4, 5]ChallengeIn-pla...
分类:其他好文   时间:2015-11-25 06:40:54    阅读次数:153
[CareerCup] 14.6 CircularArray 环形数组
14.6 Implement a CircularArray class that supports an array-like data structure which can be efficiently rotated.The class should use a generic type, ...
分类:编程语言   时间:2015-11-24 14:28:48    阅读次数:195
804条   上一页 1 ... 31 32 33 34 35 ... 81 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!