Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
                            
                            
                                分类:
其他好文   时间:
2015-01-25 16:34:51   
                                阅读次数:
151
                             
                    
                        
                            
                            
                                问题描述:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X=“x0,x1,…,xm-1”,序列Y=“y0,y1,…,yk-1”是X的子序列,存在X的一个严格递增下标序列,使得对所有的j=0,1,…,k-1,有xij=yj...
                            
                            
                                分类:
其他好文   时间:
2015-01-25 16:30:43   
                                阅读次数:
253
                             
                    
                        
                            
                            
                                后缀数组的用处:快速求出两个后缀Suffix(i), Suffix(j)的最长公共前缀(LCP, Longest Common Perfix)以下一张图片可谓简洁明了。下面贴上模板1.求最长重复子串,可以重叠void solve_duplicate_substr(int n){//duplicate...
                            
                            
                                分类:
编程语言   时间:
2015-01-25 15:04:43   
                                阅读次数:
311
                             
                    
                        
                            
                            
                                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-01-25 11:03:14   
                                阅读次数:
129
                             
                    
                        
                            
                            
                                Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba”,T is "ece" which ...
                            
                            
                                分类:
其他好文   时间:
2015-01-25 06:31:56   
                                阅读次数:
141
                             
                    
                        
                            
                            
                                原题地址以前可以用DP枚举所有回文串,但是Leetcode后来增加了几组大数据,用DP会超时。什么!用DP都超时了??那怎么办?答:二分法尝试可能的回文串长度,直到找到最大值需要注意的是,假设现在已经验证了长度为length的回文串不存在,传统的二分法就会去尝试长度为length/2的回文串是否存在...
                            
                            
                                分类:
其他好文   时间:
2015-01-24 19:57:26   
                                阅读次数:
127
                             
                    
                        
                            
                            
                                给定一个序列,判断该序列是不是二叉搜索树的后序遍历序列
二叉搜索树定义:
二叉查找树(英语:Binary Search Tree),也称二叉搜索树、有序二叉树(英语:ordered binary tree)
,排序二叉树(英语:sorted binary tree),是指一棵空树或者具有下列性质的二叉树:
1、若任意节点的左子树不空,则左子树上所有结...
                            
                            
                                分类:
其他好文   时间:
2015-01-23 23:06:05   
                                阅读次数:
220
                             
                    
                        
                            
                            
                                Write a function to find the longest common prefix string amongst an array of strings.
题意:求字符串数组的最长公共前缀
思路:首先找到最短的那个作为标尺,然后每次比较。
class Solution {
public:
    string longestCommonPrefix(vector &st...
                            
                            
                                分类:
其他好文   时间:
2015-01-23 21:38:51   
                                阅读次数:
147
                             
                    
                        
                            
                            
                                题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters ...
                            
                            
                                分类:
其他好文   时间:
2015-01-23 21:19:32   
                                阅读次数:
187
                             
                    
                        
                            
                            
                                横版流程卡 优化(复杂SQL的优化),留档一、横版流程卡原SQL 1 SELECT SOL.*,para.* FROM 2 (SELECT 3 A.SERIAL_NUMBER, 4 SUM(casewhen B.spc_item='Speed'and SUBS...
                            
                            
                                分类:
其他好文   时间:
2015-01-23 20:02:21   
                                阅读次数:
252