Strings¶
Deep
Strings matter because many pattern problems are really about structure in sequences.
Use This Area When¶
- the problem is about repeated pattern checks, substring structure, or many string queries
- exact matching matters more than raw simulation
- the right mental model is prefixes, automata, palindromes, or suffix structures
Start With One Route¶
| If your bottleneck is... | Open first | Then |
|---|---|---|
| one-pattern exact matching | KMP | Z-Function, then Hashing |
| many patterns or dictionary matching | Trie | Aho-Corasick |
| palindrome structure | Palindromes / Manacher | Eertree / Palindromic Tree |
| full substring index structures | Suffix Array And LCP | Suffix Automaton, Suffix Tree |
Core Progression¶
Core first- KMP
- Z-Function
-
Hashing
-
Then add - Palindromes / Manacher
- Trie / Aho-Corasick
-
Suffix Array And LCP
-
Deep later - Eertree / Palindromic Tree
- Regular Expressions / Finite Automata
- Suffix Automaton
- Suffix Tree
Good First Repo Anchors¶
Browse All Subtopics¶
- Hashing
- KMP
- Z-Function
- Palindromes / Manacher
- Eertree / Palindromic Tree
- Trie
- Aho-Corasick
- Regular Expressions / Finite Automata
- Suffix Tree
- Suffix Array And LCP
- Suffix Automaton
Go Deeper¶
- Reference: CP-Algorithms
- Reference: OI Wiki
- Practice: ICPC Problem Archive
- Practice: CSES Problem Set
- Reference: KACTL