mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 12:11:28 +08:00
docs(DP): update LevenshteinDistance.java
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* @author Kshitij VERMA (github.com/kv19971)
|
||||
* LEVENSHTEIN DISTANCE dyamic programming implementation to show the difference between two strings (https://en.wikipedia.org/wiki/Levenshtein_distance)
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class LevenshteinDistance {
|
||||
@ -16,6 +13,7 @@ public class LevenshteinDistance{
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
private static int calculate_distance(String a, String b) {
|
||||
int len_a = a.length() + 1;
|
||||
int len_b = b.length() + 1;
|
||||
@ -43,6 +41,7 @@ public class LevenshteinDistance{
|
||||
return distance_mat[len_a - 1][len_b - 1];
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String a = ""; // enter your string here
|
||||
String b = ""; // enter your string here
|
||||
|
Reference in New Issue
Block a user