Suffix Automaton
(content/string/suffix_automaton.h)
(Incomplete list of) Useful things to know about SAM:
- The suffix link tree (SLT) is a suffix trie that has its paths compressed (i.e. a path with no branches will get compressed to one edge).
- To find number of distinct substrings of multiple strings, just reset
SAM.last
to 0
in between strings.
TODO: add fn to construct suffix link tree
Depends on
Code
Back to top page