This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE 373 Spring 2010 HW #5 Chao Xu(106978083), Xiaodi Zheng(106718764) 1 The best alignment between the string pairs “watch the movie raising Arizona?” and “watch the mets raze Arizona?” is MMMMMMDSSMMDSSSMMMDDDSSMMMMMMMMM, with a matching cost of 12. The best alignment between the string pairs “this is what happens when I type slow” and “htishisth whaty havpens when ui type fasht is SSMMSSMMIIMMMMMIMMMSMMMMMMMMMMISMMMMMMISSSSM, with a matching cost of 14. The best alignment between the string pairs “leonard skiena” and “lynard skynard” is MDSMMMMM MMDSMMIIM, with a matching cost of 6. 1 2 83 (a) Let f [ i,j ] denote the length of the matching substring that ends at the i th element of X and the jth element of Y . then the recurrence function is defined as: f [ i,j ] = f [ i 1 ,j 1] + 1 if X [ i ] == Y [ i ] f [ i,j ] = 0 if X [ i ]! = Y [ i ] Build the matrix in O ( mn ) time. Search though the matrix for the largest value k in O ( mn ) time. If it’s at ( i,j ) of the matrix, output X [ i k ] to X [ i ]....
View
Full
Document
This note was uploaded on 06/05/2011 for the course CSE 373 taught by Professor Hart,g during the Spring '08 term at SUNY Stony Brook.
 Spring '08
 Hart,G

Click to edit the document details