Aho–Corasick (AC) Algorithm (Multiple String Search String Search)

From Algorithm Wiki
Jump to navigation Jump to search

Time Complexity

$O(n + m + z)$

Space Complexity

$O(km)$ words

(Derived: Number of states of the automaton that is created)

Description

Automaton-based, finite automaton that tracks the partial prefix match

Approximate?

Exact

Randomized?

No, deterministic

Model of Computation

Word RAM

Year

1975

Reference

https://cr.yp.to/bib/1975/aho.pdf