[10 points] Compute the edit distance between paris and alice. Write down the 5 x 5 array of distances between all prefixes as computed by following...
View the step-by-step solution to:

Question

 ​Compute the edit distance between ​paris ​and ​alice​. Write down the 5 ​× ​5 array of

distances between all prefixes as computed by following the algorithm. 



20.png

20.png

1. [10 points] Compute the edit distance between paris and alice. Write down the 5 x 5 array of distances
between all prefixes as computed by following the algorithm.
EDITDISTANCE($1, $2)
1 int mi, j] = 0
2 fori + 1 to |$1]
3 do mi,0 =i
4 for j + 1 to |$2|
5 do mo, j= j
6 fori + 1 to |s1|
7 do for j + 1 to |$2
8
do mi, j] = min(m[i - 1, j - 1) + if (s, [i] = $2[j]) then 0 else 1fi,
9
mi-1,j+1,
10
11 return ms, | |$2]]
mij-1]+1}
The format of the result should look similar to the following figure
To
1 1
2 2
3 3
4
4
C
1 2
2 3
3 4
4
5
2 1
2 2
3 3
4
4
2
2 2
1 3
3
4
4
5
2
3 2
3 1
2
2
3
3
3
3
3 2
2
3
3
4
3
4 2
3
2
3
2
4
4
4
3
2
3
3
3
5
4
5 3
4
2
3
3

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes