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


The longest common subsequence problem revisited
Authors:A Apostolico and C Guerra
Affiliation:(1) Department of Computer Sciences, Purdue University, 47907 West Lafayette, IN, USA
Abstract:This paper re-examines, in a unified framework, two classic approaches to the problem of finding a longest common subsequence (LCS) of two strings, and proposes faster implementations for both. Letl be the length of an LCS between two strings of lengthm andn gem, respectively, and let s be the alphabet size. The first revised strategy follows the paradigm of a previousO(ln) time algorithm by Hirschberg. The new version can be implemented in timeO(lm · min logs, logm, log(2n/m)), which is profitable when the input strings differ considerably in size (a looser bound for both versions isO(mn)). The second strategy improves on the Hunt-Szymanski algorithm. This latter takes timeO((r +n) logn), whererlemn is the total number of matches between the two input strings. Such a performance is quite good (O(n logn)) whenrsimn, but it degrades to THgr(mn logn) in the worst case. On the other hand the variation presented here is never worse than linear-time in the productmn. The exact time bound derived for this second algorithm isO(m logn +d log(2mn/d)), whered ler is the number ofdominant matches (elsewhere referred to asminimal candidates) between the two strings. Both algorithms require anO(n logs) preprocessing that is nearly standard for the LCS problem, and they make use of simple and handy auxiliary data structures.
Keywords:Design and analysis of algorithms  Longest common subsequence  Dictionary  Finger-tree  Characteristic tree  Dynamic programming  Efficient merging of linear lists
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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