首页 | 本学科首页   官方微博 | 高级检索  
     

求最长公共子串问题的算法分析
引用本文:张毅超,车玫,马骏. 求最长公共子串问题的算法分析[J]. 计算机仿真, 2007, 24(12): 97-100,116
作者姓名:张毅超  车玫  马骏
作者单位:中国航天科技集团公司第710研究所,北京,100037;中国航天科技集团公司第710研究所,北京,100037;中国航天科技集团公司第710研究所,北京,100037
摘    要:高效求解2个字符串的最长公共子串(Longest Common Substring)是实现很多字符串算法的关键.文中首先给出了求解LCP问题的动态规划算法,广义后缀树算法,研究并分析了这两种算法,得出动态规划算法易于理解,但时间复杂度较高;广义后缀树算法的时间复杂度较低,但实现较为复杂并且广义后缀树占用的空间也较多.最后提出了一个新算法,该算法使用2个字符串的广义后缀数组,在保持和广义后缀树时间复杂度相等的基础上,可以简单地实现并且占用较少的空间.

关 键 词:最长公共子串  动态规划  广义后缀树  广义后缀数组
文章编号:1006-9348(2007)12-0097-04
收稿时间:2006-11-14
修稿时间:2006-11-27

Analysis of the Longest Common Substring Algorithm
ZHANG Yi-chao,CHE Mei,MA Jun. Analysis of the Longest Common Substring Algorithm[J]. Computer Simulation, 2007, 24(12): 97-100,116
Authors:ZHANG Yi-chao  CHE Mei  MA Jun
Abstract:How to solve the longest common substring of two strings efficiently is the key to many string algorithms.Firstly this paper gives two algorithms to solve LCP problem.One is the dynamic programming(DP) algorithm,and the other is generalized suffix tree(GST) algorithm.The DP algorithm is easy to implement,however with a high time complexity.The time complexity of GST algorithm is low,however it needs much more trick to implement and takes much storage space.At the end,this paper shows a generalized suffix array(GSA) algorithm which has the same time complexity as the GSA algorithm and takes less storage space than GST algorithm.
Keywords:Longest common substring  Dynamic programming  Generalized suffix tree  Suffix array
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号