Problem Description
Let A be an integral series {A1, A2, . . . , An}.
The zero-order series of A is A itself.
The first-order series of A is {B1, B2, . . . , Bn-1},where Bi = Ai+1 - Ai.
Th...
分类:
编程语言 时间:
2014-08-08 16:12:48
阅读次数:
200
Also the very first problem on EPI.class Solution {public: int maxProfit(vector &prices) { size_t len = prices.size(); if (len = pric...
分类:
其他好文 时间:
2014-08-08 15:53:26
阅读次数:
170
// my first program in C++ #include using namespace std; int main() { cout << “Hello World!”; return 0; }
分类:
编程语言 时间:
2014-08-08 15:10:06
阅读次数:
212
My first solution was DFS - TLE. Apparently, DFS with TLE usually means DP.1D DP + Rolling Array:class Solution {public: bool wordBreak(string s, u...
分类:
其他好文 时间:
2014-08-08 08:27:25
阅读次数:
280
Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo...
分类:
其他好文 时间:
2014-08-08 01:52:15
阅读次数:
194
Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents...
分类:
其他好文 时间:
2014-08-08 01:51:45
阅读次数:
214
看到别人写的,都看不进去,算了还是自己手写一遍吧,算是帮助自己理解了。写的比较简单,例子也比较好懂,什么时候使用自己看着办。1.定义装饰者模式:动态地将职责附加到对象上。若要扩展功能,装饰者提供比继承更有弹性的替代方案。装饰者和被装饰者对象都哟相同的超类。装饰者会使程序中出现很多小类,增加使用难度可...
分类:
其他好文 时间:
2014-08-07 22:46:45
阅读次数:
290
一、非变异算法
是一组不破坏操作数据的模板函数,用来对序列数据进行逐个处理、元素查找、子序列搜索、统计和匹配。非变异算法具有极为广泛的适用性,基本上可应用与各种容器。
1查找容器元素find
它用于查找等于某值的元素。它在迭代器区间[first,last)(闭开区间)上查找等于value值的元素,如果迭代器i所指的元素满足*i=value,则返回迭代器i;未找到满足条件的元素,返...
分类:
其他好文 时间:
2014-08-07 18:59:50
阅读次数:
306
Problem Description
Let A be an integral series {A1, A2, . . . , An}.
The zero-order series of A is A itself.
The first-order series of A is {B1, B2, . . . , Bn-1},where Bi = Ai+1 - Ai.
The ...
分类:
其他好文 时间:
2014-08-07 18:59:40
阅读次数:
248
Problem Description:
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at tha...
分类:
其他好文 时间:
2014-08-07 15:42:10
阅读次数:
180