問題描述
序列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
This cookbook contains a wealth of solutions to problems that SQL programmers face all the time. Recipes inside range from how to perform simple tasks, like importing external data, to ways of handling issues that are more complicated, like set algebra. Each recipe includes a discussion that explains the logic and concepts underlying the solution. The book covers audit logging, hierarchies, importing data, sets, statistics, temporal data, and data structures.
標簽:
programmers
solutions
cookbook
contains
上傳時間:
2013-12-08
上傳用戶:Altman