Due: Friday, 1 Feb 2008
We define precisely what we mean by "commonality." First, a sequence x=x1x2...xn over a finite set S is a list of n of elements from a set S. Another sequence y=y1y2...ym from S is a subsequence of x if it can be formed by deleting some of the elements (possibly none) from x without disturbing the relative order of the remaining elements. For example,
GACCCis a subsequence of
GAACCACGCCThe percentage of commonality of two sequences x=x1x2...xn and y=y1y2...ym is defined to be c = 100 * (k / ((n+m)/2)) where k is the length of the longest subsequence of both x and y.
ABCDE ABCDE ABCDE ABZDE ABCD ABCXYZthen the output is
Case #1: 100% Case #2: 80% Case #3: 60%
Turn in the Java source code for the program using the submission server. The project tag for this project is proj04. The name of the file you submit must be Shared.java. Acknowledgement of project submissions can be found on the WWW.
|
Course=cse4051 Project=proj04 |