string

What

Idea

  • Compares the hash of a string p (pattern) with substrings of t (target) of length len(p)
  • Check for exact match after found, so the worst case can still be .
    • hashing is used as a heuristic to narrow down the search space.

Properties

  • Can be used to find matches for multiple (k) patterns simultaneously.
    • In space.
  • Finding multiple matches has expected time of the combined length of all matches.

Complexity

  • Time:
    • Average:
    • Worst:
  • Space: