DFS + Memorized Search (DP)class Solution { int dfs(int i, int j, int row, int col, vector>& A, vector>& dp) { if(dp[i][j] != 0) retu...
分类:
其他好文 时间:
2015-11-16 06:09:19
阅读次数:
287
In?the topic describing TCP‘s Maximum Segment Size (MSS) parameter, I explained the trade-off in determining the optimal size of TCP segments. If segments are too large, we risk having them become...
Longest Increasing SubsequenceGiven an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10, 9, 2, 5, 3,...
分类:
编程语言 时间:
2015-11-15 20:29:16
阅读次数:
482
题目描述作为一名情报局特工,Nova君(2号)有着特殊的传达情报的技巧。为了避免被窃取情报,每次传达时,他都会发出两句旁人看来意义不明话,实际上暗号已经暗含其中。解密的方法很简单,分别从两句话里删掉任意多个字母,使得两句话剩余的部分相同,通过一定的删除手法,可以让剩余的部分相同且长度最大,就得到了可...
分类:
其他好文 时间:
2015-11-15 13:23:35
阅读次数:
232
Maximum sumTime Limit:1000MSMemory Limit:65536KTotal Submissions:37035Accepted:11551DescriptionGiven a set of n integers: A={a1, a2,..., an}, we defin...
分类:
其他好文 时间:
2015-11-13 14:32:19
阅读次数:
171
关于二叉树,目前在leetcode中遇到了两道题目,一道是二叉树的最大深度,一道是二叉树的最小深度;关于二叉树,整好借此机会再学习一下;二叉树是一种特殊的树,在二叉树中每个节点最多有两个子节点,一般称为左子节点和右子节点(或左孩子和右孩子),并且二叉树的子树有左右之分,其次序不能任意颠倒。二叉树是递...
分类:
其他好文 时间:
2015-11-13 06:18:37
阅读次数:
274
Longest Common SubsequenceGiven two strings, find the longest common subsequence (LCS).Your code should return the length ofLCS.ExampleFor"ABCD"and"ED...
分类:
其他好文 时间:
2015-11-11 06:28:55
阅读次数:
184
LeetCode -- Sliding Window Maximum...
问题描述最长公共子序列,英文缩写为LCS(Longest Com#include const int MAX=1010;char x[MAX];char y[MAX];int DP[MAX][MAX];int b[MAX][MAX];using namespace std;int PRINT_LCS...
分类:
其他好文 时间:
2015-11-10 19:15:57
阅读次数:
225
Removed IntervalProblem DescriptionGiven a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is referred as increasing if b1using namesp...
分类:
其他好文 时间:
2015-11-10 13:58:53
阅读次数:
195