mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 17:56:02 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -35,9 +35,13 @@ public class LevenshteinDistance {
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
distance_mat[i][j]
|
||||
= minimum(distance_mat[i - 1][j], distance_mat[i - 1][j - 1], distance_mat[i][j - 1])
|
||||
+ cost;
|
||||
distance_mat[i][j] =
|
||||
minimum(
|
||||
distance_mat[i - 1][j],
|
||||
distance_mat[i - 1][j - 1],
|
||||
distance_mat[i][j - 1]
|
||||
) +
|
||||
cost;
|
||||
}
|
||||
}
|
||||
return distance_mat[len_a - 1][len_b - 1];
|
||||
@ -47,7 +51,9 @@ public class LevenshteinDistance {
|
||||
String a = ""; // enter your string here
|
||||
String b = ""; // enter your string here
|
||||
|
||||
System.out.print("Levenshtein distance between " + a + " and " + b + " is: ");
|
||||
System.out.print(
|
||||
"Levenshtein distance between " + a + " and " + b + " is: "
|
||||
);
|
||||
System.out.println(calculate_distance(a, b));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user