cse373hw5 - CSE 373 Spring 2010 HW #5 Chao Xu(106978083),...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 8-3 (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 its at ( i,j ) of the matrix, output X [ i- k ] to X [ i ]....
View Full Document

Page1 / 10

cse373hw5 - CSE 373 Spring 2010 HW #5 Chao Xu(106978083),...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online