Problems with Levenshtein algorithm in Java

后端 未结 5 738
情深已故
情深已故 2021-02-08 20:16

I want to use the Levenshtein algorithm for the following task: if a user on my website searches for some value (he enters characters in a input), I want to instantly check for

5条回答
  •  Happy的楠姐
    2021-02-08 20:51

    import java.util.Scanner;
    
    public class Algorithmm {
        public static void main(String args[])
        {
            Scanner sc= new Scanner(System.in);
            System.out.println("Enter the correct string ");
            String correct=sc.nextLine();
            System.out.println("Enter the incorrect string ");
            String incorrect=sc.nextLine();
            int i=correct.length(),j=incorrect.length();
            ++i ; ++j;
            int a[][] = new int[i][j];
            int b[] = new int[3];       
            for(int m=0;mb[u+1])
                                                b[u]=b[u+1];
    
    
                                    a[m][n]=b[0]+1;
    
    
                                }
    
                            }
    
                }
    
    
            for(int m=0;m

提交回复
热议问题