GATE Computer ScienceHardGATE CSE · NIELIT
With unit cost for insertion, deletion and substitution, what is the edit distance between INTENTION and EXECUTION?
- A. 5
- B. 6
- C. 7
- D. 4
Correct answer: A. 5
The Levenshtein DP table gives 5 (for example delete I, substitute N→E, T→X, insert C, and keep the rest aligned).
More Algorithms questions
- Six matrices have dimensions 30×35, 35×15, 15×5, 5×10, 10×20 and 20×25 in a chain. What is the minimum number of scalar multiplications to…
- Quicksort uses the last element of each sub-array as pivot and compares every other element of the sub-array with it once. On [4, 7, 1, 9…
- Consider T(n) = T(n/2) + T(n/3) + T(n/6) + n with T(1) = 1. Which bound is tight?
- Dijkstra's algorithm from vertex 0 runs on the undirected graph with edges (0,1,7), (0,2,9), (0,5,14), (1,2,10), (1,3,15), (2,3,11)…
- Top-down merge sort (standard two-way merge, one comparison per element moved while both lists are non-empty) sorts [38, 27, 43, 3, 9, 82…
- A fractional knapsack of capacity 20 can take items with (value, weight) = (40,8), (30,5), (24,6), (50,10), (18,3), (35,7), fractions…