cse373hw5

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

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

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

View Full Document

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

View Full Document
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 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.

### 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
Ask a homework question - tutors are online