Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Algorithm should return edit distance between two input strings. s1 and s2. public int edit (String s1, String s2){ int len1 = s1.length; int len2

Algorithm should return edit distance between two input strings. s1 and s2.

public int edit (String s1, String s2){

int len1 = s1.length;

int len2 = s2.length

int m[][] = new int = [len1+1] [length2 +1];

//Hint for i = 1 to len1 m[i, 0] = i; for j = 1 to len2 m[0, j] = j; for i = 1 to len1 for j = 1 to len2 m[i, j] = min( m[i-1, j-1] + f(i,j), m[i-1, j] + 1, m[i, j-1] + 1 );

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt 6 7 4 .

Answered: 1 week ago