1.

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.(a) True(b) FalseThe question was asked during a job interview.My enquiry is from Edit Distance Problem topic in portion Dynamic Programming of Data Structures & Algorithms II

Answer» RIGHT option is (a) True

The explanation is: Consider the STRINGS “abcd” and “efghi”. The string “efghi” can be CONVERTED to “abcd” by deleting “i” and converting “EFGH” to “abcd”. The cost of transformation is 5, which is equal to the length of the larger string.


Discussion

No Comment Found

Related InterviewSolutions