Mark As Completed Discussion

The Column for Letter "E"

Now that we've filled in the column for the letter B, let's move on to the column for the letter E from the string best.

Calculating the Costs

Starting with E and T, we again find that the two letters are different, so the edit cost is 1. Here are the calculations for the cell:

  1. From Above: (1 + 1 = 2)
  2. From the Left: (2 + 1 = 3)
  3. From the Diagonal: (1 + 1 = 2)

The minimum of these is 2, so we place it in the cell where E intersects with T.

Next, we move to E and e. The two letters are the same, so the edit cost is 0. The calculations for this cell are:

  1. From Above: (2 + 1 = 3)
  2. From the Left: (1 + 1 = 2)
  3. From the Diagonal: (0 + 1 = 1)

The minimum is 1, so we place it in the cell where E intersects with e.

The Updated Matrix

Here's how our matrix looks after filling in the "E" column:

bEst
01234
T112
e221
s332
t443

We've successfully filled in the second column for the letter E. As before, we'd continue this process for the remaining columns to complete the matrix and find the total edit distance.