string

What

An pattern searching algorithm in linear time that uses dynamic programming.

Idea

Implementation

Trick: equivalent to calculating lsp(p + sep + t) where sep is a character not in t or p

Complexity

  • Time:
  • Space:

Properties

  • Matches multiple (k) pattern take time.
  • Finding multiple matches does not increase complexity.