Question: char s 1 [ 9 ] = superhero ; char s 2 [ 8 ] = theropod ; intn = 9 ; int m =

char s1[9]=superhero; char s2[8]=theropod; intn=9;
int m=8;
int [][] states = int [n+1][m+1];
for (int i =0; i <= n; i++){ states[i][0]= i;
}
for (int j=0; j<=m; j++){ states[0][j]= j;
}
for (int i =1; i <= n; i++){ for (int j=1; j<=m; j++){
if (s1[i1]== s2[j1]){ states[i][j]= states[i1][j1];
}else{
states[i][j]=1+ min(states[i1][j], min(states[i][j1], states[i1][j1]));
}}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!