Since we are not allowed to rob two adjacent houses, we keep two variablespreandcur. During thei-th loop,prerecords the maximum profit that we do not ...
分类:
其他好文 时间:
2015-08-15 11:54:05
阅读次数:
114
Description
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists ...
分类:
其他好文 时间:
2015-08-14 21:36:30
阅读次数:
210
DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence....
分类:
其他好文 时间:
2015-08-14 21:12:47
阅读次数:
145
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Show Tags
Show Similar Proble...
分类:
其他好文 时间:
2015-08-14 01:11:52
阅读次数:
136
Common Subsequence
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 43303
Accepted: 17580
Description
A subsequence of a given sequence is the given sequence ...
分类:
其他好文 时间:
2015-08-13 22:28:17
阅读次数:
135
Best Time to Buy and Sell Stock III
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 a...
分类:
其他好文 时间:
2015-08-13 22:21:51
阅读次数:
180
问题描述:LIS(Longest Increasing Subsequence)最长上升(不下降)子序列,有两种算法复杂度为O(n*logn)和O(n^2)。在上述算法中,若使用朴素的顺序查找在D1..Dlen查找,由于共有O(n)个元素需要计算,每次计算时的复杂度是O(n),则整个算法的时间复杂度...
分类:
其他好文 时间:
2015-08-13 21:57:56
阅读次数:
185
Best Time to Buy and Sell Stock II
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 m...
分类:
其他好文 时间:
2015-08-13 18:05:07
阅读次数:
190
MTU 最大传输单位
通过上面 MAC 封装的定义,现在我们知道标准以太网络frame所能传送的数据量最大可以到达 1500 bytes , 这个数值就被我们称为 MTU (Maximum Transmission Unit, 最大传输单位)。 你得要注意的是,每种网络接口的 MTU 都不相同,因此有的时候在某些网络文章上面你会看到 1492 bytes 的 MTU 等等。不过,...
分类:
其他好文 时间:
2015-08-13 10:06:12
阅读次数:
163
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...
分类:
其他好文 时间:
2015-08-12 21:28:06
阅读次数:
125