問題描述
序列Z=<B,C,D,B>是序列X=<A,B,C,B,D,A,B>的子序列,相應的遞增下標序列為<2,3,5,7>。
一般地,給定一個序列X=<x1,x2,…,xm>,則另一個序列Z=<z1,z2,…,zk>是X的子序列,是指存在一個嚴格遞增的下標序列〈i1,i2,…,ik〉使得對于所有j=1,2,…,k使Z中第j個元素zj與X中第ij個元素相同。
給定2個序列X和Y,當另一序列Z既是X的子序列又是Y的子序列時,稱Z是序列X和Y的公共子序列。
你的任務是:給定2個序列X、Y,求X和Y的最長公共子序列Z。
標簽:
lt
序列
上傳時間:
2014-01-25
上傳用戶:netwolf
Written by the inventors of the technology, The Java™ Language Specification, Third Edition, is the definitive technical reference for the Java™ programming language. If you want to know the precise meaning of the language s constructs, this is the source for you.
The book provides complete, accurate, and detailed coverage of the Java programming language. It provides full coverage of all new features added since the previous edition, including generics, annotations, asserts, autoboxing, enums, for-each loops, variable arity methods, and static import clauses.
標簽:
Specification
technology
the
inventors
上傳時間:
2016-01-26
上傳用戶:youmo81