- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- Consider the two strings “”(empty string...

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

View all MCQs in:
Design and Analysis of Algorithms

- 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.
- In the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to the length of the string.
- 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.

Login to Continue

It will take less than 2 minutes

Report MCQ