What are some algorithms for comparing how similar two strings are?

后端 未结 5 1454
故里飘歌
故里飘歌 2020-11-30 17:45

I need to compare strings to decide whether they represent the same thing. This relates to case titles entered by humans where abbreviations and other small details may di

5条回答
  •  北海茫月
    2020-11-30 18:30

    You may use the algorithm of computing the length of the longest common sub-sequence to solve the problem. If the length of the longest common sub-sequence for both the input strings is less than the length of either of the strings, they are unequal.

    You may use the approach of dynamic programming to solve the problem and optimize the space complexity as well in case you don't wish to figure out the longest common sub-sequence.

提交回复
热议问题