Skip to content

Strings -> Trie

Prefix trees for dictionary queries, prefix counting, lexicographic traversal, and automaton building blocks.

  • Topic slug: strings/trie
  • Tutorial page: Open tutorial
  • Ladder page: Open ladder
  • Repo problems currently tagged here: 2
  • Repo companion pages: 0
  • Curated external problems: 4

Microtopics

  • prefix-tree
  • dictionary-queries
  • terminal-nodes
  • alphabet-optimization
  • lexicographic-traversal
  • compressed-trie

Learning Sources

Source Type
Princeton Tries Course
USACO Guide string searching Reference

Practice Sources

Source Type
CSES Word Combinations Practice
CSES Finding Patterns Practice

Curated External Problems

Core

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
Watto and Mechanism Codeforces Medium Hashing Implementation; Branching Search Trie Basics; Edit-Distance-1 Checking Approximate Matching; One-Edit; Dictionary; Lookup A very common trie exercise with one-character-mismatch queries.
Word Combinations CSES Medium DP Dynamic Programming; Data-Structure-Heavy Trie Basics; DP On Prefixes Dictionary Matching; Dictionary; Prefixes; Counting A classic trie-plus-DP word segmentation problem.
trie Library Checker Medium Data-Structure - - Insert; Lookup Pure trie implementation benchmark with the cleanest possible scope.

Challenge

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
A Lot of Games Codeforces Hard Game-Theory Game-State Analysis Trie; Winning/Losing States Games; Winning-States; Game-DP; Prefix-Tree Trie structure is the whole game board here.

Repo Problems

Code Title Fit Difficulty Pattern Note Solution
FINDINGPATTERNS Finding Patterns secondary medium aho-corasick automaton; failure links; multi-pattern presence queries Note Code
WORDCOMBINATIONS Word Combinations primary medium trie plus dp; dictionary segmentation; suffix counting Note Code

Regeneration

python3 scripts/generate_problem_catalog.py