Well, this problem has the highest acceptance rate among all OJ problems. It has a very easy 1-line reursive solution. I am not sure whether this one ...
分类:
其他好文 时间:
2015-08-15 19:49:12
阅读次数:
131
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
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
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
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
题目如下:
According to Wikipedia:
Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from ...
分类:
其他好文 时间:
2015-08-13 14:31:46
阅读次数:
119
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
题目:
数组中有一个数字出现的次数超过数组长度的一半,请找出这一个数字。输入一个长度为9的数组{1,2,3,2,2,2,5,4,2},
数字2在数组中出现的次数大于数组长度的一半,返回2。
这道题类似以前做过的Maximum Subarray。
按着以前的思路:
确定某一个数字,遇到相同的数字加1,遇到不同的数字减1,当累加器为0时,我们重新开始计算即可。
完成后继续判断这个数...
分类:
编程语言 时间:
2015-08-12 13:18:44
阅读次数:
160
设置:单个设置Shader.maximumLOD、全局设置Shader.globalMaximumLOD、QualitySettings里面的Maximum LODLevel 原理:小于指定值的shader和subshader才能被使用。 应用:有时候一些显卡虽然支持很多特性,但是效率很低,此时就可...
分类:
其他好文 时间:
2015-08-12 12:59:57
阅读次数:
133