题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-03-02 00:55:58
阅读次数:
237
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-02-01 10:46:16
阅读次数:
251
题目:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a s...
分类:
编程语言 时间:
2015-01-31 16:09:35
阅读次数:
170
题目:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note...
分类:
编程语言 时间:
2015-01-31 01:44:45
阅读次数:
205
题目Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the va...
分类:
系统相关 时间:
2015-01-30 17:19:54
阅读次数:
162
题目: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).Find the minimum element.Yo...
分类:
编程语言 时间:
2015-01-30 01:18:23
阅读次数:
310
题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ...
分类:
编程语言 时间:
2015-01-30 01:16:29
阅读次数:
200
题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted fro...
分类:
编程语言 时间:
2015-01-30 00:00:31
阅读次数:
368
题目:与上一道题几乎相同;不同之处在于array中允许有重复元素;但题目要求也简单了,只要返回true or falsehttp://www.cnblogs.com/xbf9xbf/p/4254590.html代码:oj测试通过Runtime:73 ms 1 class Solution: 2 .....
分类:
编程语言 时间:
2015-01-28 00:56:28
阅读次数:
145
题目: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-01-27 23:29:46
阅读次数:
256