Data Structures & AlgorithmsHardICPC regional · strings

Problem: Which problem is solved by the Aho-Corasick automaton?

  1. A. Shortest path with negative edges
  2. B. Minimum spanning tree
  3. C. Finding all occurrences of many patterns in one text pass
  4. D. Assignment problem

Correct answer: C. Finding all occurrences of many patterns in one text pass

Aho-Corasick builds a trie with failure links, so a single scan of the text reports every pattern occurrence.

More Coding Interview Problems questions

Exams that ask this topic