Compute edit distance kitten->sitting, show alignment
Analyze the compute edit distance kitten->sitting, show alignment.
Examples
Input:"test_input_1"
Output:"output_1"
Input:"test_input_2"
Output:"output_2"
Hints
Start by initializing a DP table where dp[i][j] represents the edit distance between the first i characters of "kitten" and the first j characters of "sitting".
Fill the DP table by considering three operations: insertion (cost 1), deletion (cost 1), and substitution (cost 1 if characters differ, 0 if same).
Trace back from dp[6][7] to reconstruct the optimal alignment, ensuring the path reflects the minimum total cost operations.
Compute edit distance kitten->sitting, show alignment
Analyze the compute edit distance kitten->sitting, show alignment.