Order the steps

Report a typo

How can we calculate the Levenshtein distance? Put the steps in the correct order.

First, don't forget to find out how long the strings are!

Put the items in the correct order
Choose the final score that is the Levenshtein distance
Calculate the lengths of the two strings (suppose s1 and s2)
Using the formula, fill the rest of the cells with scores
Initialize the first row of the matrix with indices from 0 to the length of s2, and the first column with indices from 0 to the length of s1
Create a distance matrix with the number of rows equal to the length of s1+1, and the number of columns equal to the length of s2 + 1.
___

Create a free account to access the full topic