最长公共子序列(LCS,Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。而最长公共子串(要求连续)和最长公共子序列是不同的。设X(m)={x(1), x(2)...
分类:
其他好文 时间:
2015-10-26 00:37:29
阅读次数:
202
QuestionGiven an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array,...
package cn.edu.xidian.sselab;/*** Given a binary tree, find its maximum depth.* The maximum depth is the number of nodes along the longest path from t...
分类:
其他好文 时间:
2015-10-24 23:32:01
阅读次数:
262
求s1是否是s2的子串。分析:例如sequence 和 subsequence 。从头开始比较,s1[0]与s2[0]相同,那么它们下标都可+1,接着比较s1[1]和s2[1],不相同;这时应该保证s1[1]不动,而把s2下标+1.直到s1,s2下标移动到最后一位,若s1下标移动到了最后一位,显然判...
分类:
其他好文 时间:
2015-10-24 20:13:53
阅读次数:
250
import subprocessimport multiprocessingimport urllibimport sysimport osimport pymongoimport signalimport timeclient=pymongo.MongoClient("192.168.139.1...
分类:
其他好文 时间:
2015-10-23 18:34:04
阅读次数:
263
本文研究的总结,欢迎转载,但请注明出处:http://blog.csdn.net/pistolove/article/details/41964475Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The...
分类:
其他好文 时间:
2015-10-23 15:57:20
阅读次数:
172
Maximum SumTime Limit:500MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1146DescriptionGiven a 2-dimensional array of pos...
分类:
其他好文 时间:
2015-10-22 14:06:16
阅读次数:
133
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-10-22 12:04:38
阅读次数:
148
两个JS库都重写了Math.pow方法,导致的递归死循环解析。
分类:
Web程序 时间:
2015-10-21 20:42:25
阅读次数:
239
题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.分析:固定一个点,遍历其余点,期间用一个HashMap记录两点斜率和斜率次数,求出局部最大值;然...
分类:
其他好文 时间:
2015-10-21 12:04:46
阅读次数:
144