I am searching for an algorithm to compare two strings efficiently without occupying much memory and in less time. So what I am currently doing is, compressing character string first and then comparing both compressed string(to avoid memory errors. as string could be very long here)
String contains characters from set [0-9],x,o,X.
Now compression rule is like only certain repetitive tokens need to be compressed. For example: 'o' is end of token and it comes always at end of sequence of one or more digits(0-9},'x' is to show multiplication etc.
Examples: 1. 8o8o80 should be compressed as 3x80 2. 8oXXXX should be compressed as 804xX 3. 64o8o8o16o16o should be 64o2x8o2x16o etc..
I wonder if is there any existing algorithms for such compression strings?
Will appreciate any kind of help to sort this out. Thanks!!