This visualisation uses AI Generated code, finetuned for the best visualisation, not code quality
kmp.mov
Interactive Raylib explainer for Knuth-Morris-Pratt string matching, showing LPS construction, mismatch fallback, skip correctness, and a full execution trace across multiple teaching pages.
- How the LPS table is built from repeated prefix/suffix structure
- How KMP avoids restarting from scratch on mismatches
- Why overlap information justifies the skip
- A live trace of pattern matching, fallback micro-operations, and runtime savings
flowchart LR
A["Pattern"]
B["Build LPS Table"]
C["Scan Text"]
D["Mismatch"]
E["Fallback Via LPS"]
F["Continue Matching"]
A --> B
B --> C
C --> D
D --> E
E --> F
F --> C
q: quit- Page-specific stepping and teaching controls are displayed in-app
make run