I am looking for an algorithm to search a substring in a string. I know there are a number of wellknown Algorithms like Knuth-Morris-Pratt, for instance, and I suppose most preimplemented functions use one of those. However, I remember a lecture, long ago, where the lecturer said that the usefullness of such an algorithm depends partly on the size of the alphabet. KMP and BMH obviously work fine on an ordinary 26-letter alphabet. But what do I do if I have a much smaller alphabet (say, DNA: 4 letters or simply a binary)?
Are there an particular algorithms that work well on very small alphabets? I googled and supposed I should easily find something as searching through DNA is rather common, but to no avail. Any help?
Please do not downvote, this is my first question in this subcommunity, I do not know yet what is considered too basic here and what is ok.