Skip to content

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

  1. Core first
  2. KMP
  3. Z-Function
  4. Hashing

  5. Then add

  6. Palindromes / Manacher
  7. Trie / Aho-Corasick
  8. Suffix Array And LCP

  9. Deep later

  10. Eertree / Palindromic Tree
  11. Regular Expressions / Finite Automata
  12. Suffix Automaton
  13. Suffix Tree

Good First Repo Anchors

Browse All Subtopics

Go Deeper