Wagner-Fischer algorithm
Bug
Your program computes the distance between &quot;kittenede&quot; and &quot;s&quot; as 1.  For some reason you switched your two array indices when you initialized them:

for (i = 0; i &lt;= m; i++) {
    d[i][0] = i;
}
for (j = 0; j &lt;= n; j++) {
    d[0][j] = j;
}


should be:
for (i = 0; i &lt;= m; i++) {
    d[0][i] = i;
}
for (j = 0; j &lt;= n; j++) {
    d[j][0] = j;
}

With this change, the program correctly computes the distance between &quot;kittenede&quot; and &quot;s&quot; as 9.
Fixed length array
There's no need for this:
int[][] d = new int[100][100];

when you already know the lengths of your two strings.  You should just move that line lower and use the n and m you compute:
int[][] d = new int[n+1][m+1];