McqMate

Q. |
## Consider the two strings “”(empty string) and “abcd”. What is the edit distance between the two strings? |

A. | 0 |

B. | 4 |

C. | 2 |

D. | 3 |

Answer» B. 4 | |

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. |

5.5k

0

Do you find this helpful?

26

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- 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.
- Consider the strings “monday” and “tuesday”. What is the edit distance between the two strings?
- Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?
- Consider the string “abbccbba”. What is the minimum number of insertions required to make the string a palindrome?
- For every non-empty string, the length of the longest palindromic subsequence is at least one.
- Consider the strings “PQRSTPQRS” and “PRATPBRQRPS”. What is the length of the longest common subsequence?
- Which of the following methods can be used to solve the edit distance problem?
- The edit distance satisfies the axioms of a metric when the costs are non-negative.
- Manhattan distance is an alternative way to define a distance between two points.
- Which of the following is the longest common subsequence between the strings “hbcfgmnapq” and “cbhgrsfnmq” ?