Algorithm for linear pattern matching?

后端 未结 7 1965
失恋的感觉
失恋的感觉 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:36

    You could Build an SuffixArray and search the runtime is crazy : O ( length(pattern) ). BUT .. you have to build that array. It's only worth .. when the Text is static and the pattern dynamic .

    0 讨论(0)
提交回复
热议问题