Which of the following lines should be added to complete the above code?
arr[i-1][j] = min
arr[i][j-1] = min
arr[i-1][j-1] = min
arr[i][j] = min
8 practice sets · Page 1 of 1
Which of the following lines should be added to complete the above code?
arr[i-1][j] = min
arr[i][j-1] = min
arr[i-1][j-1] = min
arr[i][j] = min
Consider the two strings ""(empty string) and "abcd". What is the edit distance between the two strings?
0
4
2
3
Consider the strings "monday" and "tuesday". What is the edit distance between the two strings?
3
4
5
6
Suppose each edit (insert, delete, replace) has a cost of one. Then, the maximum edit distance cost between the two strings is equal to the length of the larger string.
True
False
In which of the following cases will the edit distance between two strings be zero?
When one string is a substring of another
When the lengths of the two strings are equal
When the two strings are equal
The edit distance can never be zero
Which of the following is an application of the edit distance problem?
Approximate string matching
Spelling correction
Similarity of DNA
Approximate string matching, Spelling Correction and Similarity of DNA
The edit distance satisfies the axioms of a metric when the costs are non-negative.
True
False
Which of the following methods can be used to solve the edit distance problem?
Recursion
Dynamic programming
Both dynamic programming and recursion
Greedy Algorithm