samedi 29 août 2015

Find if long string of chars contains any patterns

So I have a long string of chars for example - "wdllwdwwwlldd" The string just contains the same chars -wld (try and guess what I'm doing ;))

The string will be quite long, approx 420 chars long.

I want to find, if they exist, any patterns in the string. For example if the string was - "wllddwllddwlldd" then it "wlldd" would be the pattern that was found.

So i kind of want to find Any repeated sequences in the string.

Having done a bit of research, suffix trees and suffix arrays seem to get mentioned a lot on these problems.

Is thst correct or is there another way to do this?

I can tell that this is quite a large task and could potentially take a long time.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire