Question: Hi I wanna write a java program which is Edit distance. I have been searching for algorithm through the Internet but I was confused when
Hi I wanna write a java program which is Edit distance. I have been searching for algorithm through the Internet but I was confused when I given two strings.
Users would be given two strings and have to print output look like this results with grid, table what should I do to make it following codes below?
public int minDistance(String word1, String word2) { int m=word1.length(); int n=word2.length(); int[][] mem = new int[m][n]; for(int[] arr: mem){ Arrays.fill(arr, -1); } return calDistance(word1, word2, mem, m-1, n-1); } private int calDistance(String word1, String word2, int[][] mem, int i, int j){ if(i Edt distanc W A R S T2 234
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
