1.

Consider the two strings “”(empty string) and “abcd”. What is the edit distance between the two strings?(a) 0(b) 4(c) 2(d) 3I got this question in an interview.I'm obligated to ask this question of Edit Distance Problem in division Dynamic Programming of Data Structures & Algorithms II

Answer»

Right option is (B) 4

Easiest explanation - The empty STRING can be TRANSFORMED into “abcd” by inserting “a”, “b”, “c” and “d” at appropriate POSITIONS. Thus, the edit DISTANCE is 4.



Discussion

No Comment Found

Related InterviewSolutions