有一个价格数组,对应的位置代表改天股票的价格,你有一次买入和卖出的机会,你如何使得收益最大化。也就是返回profit。Say you have an array for which theithelement is the price of a given stock on dayi.If you ...
分类:
其他好文 时间:
2014-12-02 22:21:50
阅读次数:
177
问题一 Best Time to Buy and Sell Stock
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 on...
分类:
其他好文 时间:
2014-11-30 23:19:36
阅读次数:
232
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 complete a...
分类:
其他好文 时间:
2014-11-29 13:05:29
阅读次数:
161
Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the...
分类:
其他好文 时间:
2014-11-28 13:59:05
阅读次数:
328
题意:
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 as many transactions as you like (ie, buy one and sell one share of the stock multiple ti...
分类:
其他好文 时间:
2014-11-27 20:36:25
阅读次数:
215
请读者先看这篇文章,【C++模版之旅】项目中一次活用C++模板(traits)的经历。 对于此篇文章提出的问题,我给出一个新的思路。
talking is cheap,show me the code.
分类:
编程语言 时间:
2014-11-27 10:39:30
阅读次数:
263
题意:
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), design an algorithm to find the maximum prof...
分类:
其他好文 时间:
2014-11-27 00:17:48
阅读次数:
227
请读者先看这篇文章,【C++模版之旅】项目中一次活用C++模板(traits)的经历。 对于此篇文章提出的问题,我给出一个新的思路。
talking is cheap,show me the code....
分类:
编程语言 时间:
2014-11-26 19:07:02
阅读次数:
179
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 complet...
分类:
其他好文 时间:
2014-11-25 14:02:10
阅读次数:
175
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 complete a...
分类:
其他好文 时间:
2014-11-21 20:23:44
阅读次数:
118