De Bruijn Sequence Hot Sheet¶
Use this sheet when the statement is really about covering every length-n window exactly once and the clean route is to hide the string inside an Eulerian cycle.
Do Not Use When¶
- the graph is already explicit and the only question is Eulerian feasibility -> Eulerian hot sheet
- the task is matching or searching inside a string, not constructing one
- labels, weights, or path values dominate more than overlap structure
- the answer object is not one overlap-driven sequence
Choose By Signal¶
- every binary length-
nblock must appear once ->De Bruijn Sequence - every next block overlaps the previous one by
n - 1symbols -> same lane, model overlap states first - explicit graph, use every edge once -> Eulerian hot sheet
- graph model still unclear -> Graph cheatsheet
Core Invariants¶
- vertices are
(n - 1)-symbol overlap states - each length-
nblock is one directed edge - each traversed edge appends exactly one new symbol to the answer
- binary order-
ngraph has2^(n - 1)states and2^nedges - final linear answer is
start_state + edge_labels, so its length is2^n + n - 1
Main Traps¶
- modeling vertices as full length-
nblocks instead of overlap states - forgetting the special
n = 1case - forgetting to prefix the start state's
n - 1symbols when linearizing the cycle - checking only the graph walk and not the final string length
- reopening full string algorithms when the real bottleneck is graph modeling
Exact Starter Route¶
- exact starter -> de-bruijn-sequence-binary.cpp
- flagship in-lane rep -> De Bruijn Sequence
- graph-family compare point -> Eulerian hot sheet
- modeling compare point -> Graph Modeling
Reopen Paths¶
- full topic page -> De Bruijn Sequence
- all-edge traversal details -> Eulerian Path / Cycle
- broader graph chooser -> Graph cheatsheet