Remember
- Radix tree: fold every chain of single-child, non-terminal nodes into one edge labelled with the substring.
- Suffix tree: the radix tree of all suffixes plus a terminator. A substring query is one walk from the root.
- Aho-Corasick: failure links point to the longest suffix that is also in the trie. The scan never backs up.