Algorithm Faster BMH (Boyer-Moore-Horspool) Search

What algorithm would you use to find short substrings in short texts? In short, I mean 5-10 characters for a substring and 255 for a string. I am thinking about choosing an algorithm depending on the length of the input. Which algorithm is best suited for longer inputs?

+3
source share
4 answers

Try Turbo-BM . However, an IMO with such short lines will be sufficient for a conventional linear scan.

+5
source

If you are looking for an algorithm better than Boyer Moore, then you are asking for a mixed answer.

, Boyer Moore . .

: Boyer Moore, , .

RAM ( ).

: . .

5 200- , - 200 , - 5.

, , . , , . .

, . .

, , ( ) .

+1
+1
source

You can try Suffix Trees or Suffix arrays . Both depend on the length of the picture.

0
source

Source: https://habr.com/ru/post/1709017/


All Articles