Data Structures & AlgorithmsVery hardICPC regional · strings

Problem: Which structure gives fast membership tests of substrings after O(n) construction (for a fixed alphabet)?

  1. A. Binary heap
  2. B. Hash set of integers
  3. C. Suffix automaton
  4. D. Trie of integers

Correct answer: C. Suffix automaton

A suffix automaton recognises all substrings in linear size and time, which supports membership tests.

More Coding Interview Problems questions

Exams that ask this topic