Finding partial substrings within a string

Posted by Peter Chang on Stack Overflow See other posts from Stack Overflow or by Peter Chang
Published on 2010-09-20T03:17:22Z Indexed on 2010/12/26 3:54 UTC
Read the original article Hit count: 274

I have two strings which must be compared for similarity. The algorithm must be designed to find the maximal similarity. In this instance, the ordering matters, but intervening (or missing) characters do not. Edit distance cannot be used in this case for various reasons.

The situation is basically as follows:

string 1: ABCDEFG
string 2: AFENBCDGRDLFG

the resulting algorithm would find the substrings A, BCD, FG

I currently have a recursive solution, but because this must be run on massive amounts of data, any improvements would be greatly appreciated

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about string