GATE Computer ScienceHardGATE CSE
The edit distance (unit-cost insert, delete, substitute) between "algorithm" and "altruistic" is
- A. 6
- B. 5
- C. 7
- D. 8
Correct answer: A. 6
The final cell of the edit-distance DP table is 6.
More Algorithms questions
- Six matrices have dimensions given by the sequence 5, 10, 3, 12, 5, 50, 6 (matrix i is p[i-1] × p[i]). The minimum number of scalar…
- A binary counter starts at 0 and is incremented 1000 times. The cost of an increment is the number of bits that flip. What is the total…
- Unit-time jobs with (deadline, profit): (2,100), (1,19), (2,27), (1,25), (3,15), (3,90), (4,60), (5,10). Each job takes one slot and must…
- Keys 22, 33, 44, 12, 23, 34, 45, 1 are inserted in this order into a table of size 11 using h(k) = k mod 11 with linear probing. Counting…
- A DAG on vertices 0..5 has edges 0→2, 1→2, 1→3, 2→4, 3→4, 3→5, 4→5. How many distinct topological orderings does it have?
- A binary search (loop while low ≤ high, mid = ⌊(low+high)/2⌋) runs on a sorted array of 1000 elements. The maximum number of loop…