Say you have an array for which the ith element is the price of a given
stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
解题思路:要求两次交易的最大利润....
分类:
其他好文 时间:
2015-03-04 17:04:16
阅读次数:
157
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s...
分类:
其他好文 时间:
2015-03-04 16:34:28
阅读次数:
129
Say you have an array for which the ith element is the price of a given
stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
分类:
其他好文 时间:
2015-03-04 11:10:01
阅读次数:
125
[LeetCode] 011. Container With Most Water (Medium) (C++/Java/Python)...
分类:
编程语言 时间:
2015-03-02 23:58:34
阅读次数:
408
Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (...
分类:
其他好文 时间:
2015-03-02 22:19:15
阅读次数:
171
Sudoku is a numbers filling game, most known by people is 9x9 class, the algorithm is using confirmed numbers to get all possible numbers for each cel...
分类:
系统相关 时间:
2015-03-02 10:57:50
阅读次数:
179
A Famous Music Composer时间限制:1000ms | 内存限制:65535KB难度:1描述Mr. B is a famous music composer. One of his most famous work was his set of preludes. These 24...
分类:
其他好文 时间:
2015-02-28 13:02:03
阅读次数:
124
HBase 版本: 0.98.6thrift 版本: 0.9.0使用 thrift client with python 连接 HBase 报错: 1 Traceback (most recent call last): 2 File "D:\workspace\Python\py\hellow.....
分类:
编程语言 时间:
2015-02-27 16:28:17
阅读次数:
393
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any...
分类:
其他好文 时间:
2015-02-26 18:32:25
阅读次数:
168
Time Limit:3000MS Memory Limit:0KBDescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Team Queu...