Edit distance
The code in this project measures edit distance between two words:
Given two words word1 and word2, calculates the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitted on a word: Insert a character Delete a character Replace a character
How to run:
- Compile the Java file using the command: javac MinimalDistance.java
- Run the program using the command: java MinimalDistance word1 word2, where "word1" and "word2" are the two words for which you want to find the minimal distance.
Your task is to spot any mistakes in the code, improve its readability and highlight any performance issues if any.
Here is a list of points:
- Look at the current algorithm implementation and propose a way(s) to improve it (no coding needed here)
- Refactor code (feel free to change anything)
- Add tests. For testing purposes you can add any testing library you want.# distanceTestCase