摘要
提出了一个求序列X最长单调子序列的方法,若X的长度为n,则此方法所需时间为O(nlogn),空间占用为O(n).利用该方法可有效地求出X,Y两序列最长公共子序列的长度.如果X的长度为m,Y的长度为n,此时空间占用为O(m+n);若Y中的各个元素在X中平均重复出现至多常数次,则所需时间为O(m+nlogn).作为应用之一,该方法可以用于文本的比较、等级考试录入文本的评测等.
In this paper, a new algorithm for finding the longest monotonic subsequence of a string X was presented. The new algorithm requires O(n log n ) time and O(n) space if the length of the string X is n . By the new algorithm, the length of the longest common subsequence of strings X and Y can be found effectively and O(m+n) space is required. If the elements of Y appears in X by constant number, the algorithm requires O(m+n log n ) time. As an application, the algorithm can be used in comparison of text files and scoring the input text of an examinee.
出处
《福建农业大学学报》
CSCD
1998年第4期505-509,共5页
Journal of Fujian Agricultural University
关键词
最长单调子序列
最长公共子序列
动态选择树
longest monotonic subsequence
longest common subsequence
dynamic selecting tree