Algorithm for linear pattern matching?

后端 未结 7 1963
失恋的感觉
失恋的感觉 2021-02-03 15:49

I have a linear list of zeros and ones and I need to match multiple simple patterns and find the first occurrence. For example, I might need to find 0001101101,

7条回答
  •  别那么骄傲
    2021-02-03 16:34

    Yes.

    The Boyer–Moore string search algorithm

    See also: Knuth–Morris–Pratt algorithm

提交回复
热议问题