seqalign - for j in range(0,n 1 opt[i,j]=min(x[i!=y[j...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
def seqalign(x,y): x,y=""+x,""+y for i in range(1,m+1):opt[i,0]=i for j in range(0,n+1):opt[0,j]=j for i in range(0,m+1):
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for j in range(0,n+1): opt[i,j]=min((x[i])!=y[j])+opt[i-1,j-1],1+opt[i-1,j],1+opt[i,j-1]) return opt[m,n]...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online