Automata, Filters, Trees & Solvers: CS Classics Live
September 5, 2026 · DevTools
Some ideas only click when you watch them run: a DFA rejecting on a missing transition, a Bloom filter's first false positive, a B-tree node splitting mid-insert, a hull scan discarding a right turn. These five tools make that visible: FSM & Turing Machine Simulator, Bloom & Cuckoo Filter Simulator, B-Tree Index Visualizer, Convex Hull Visualizer, and Backtracking Solver Lab.
State machines with receipts: DFA traces and tape machines
runDfa steps a deterministic automaton over an input string and returns a full trace — start, every transition, and the rejection point — with reasons like missing-transition, not-accepting, or invalid-definition when the machine itself is malformed. Duplicate or dangling transitions are caught up front, so a broken machine never produces a misleading "rejected". Presets like the binary even-ones DFA and binary modulo-three DFA give you working machines to mutate. The Turing side, runTuringMachine, adds a tape with L/R/S moves plus separate accept and reject states.
// Even number of 1s? trace shows each transition.
runDfa(binaryEvenOnesDfa, "1011"); // rejected: odd parity
When a machine misbehaves, read the trace backwards from the rejection step — the fault is almost always one wrong edge, not the whole diagram.
Probabilistic filters and B-trees without hand-waving
hashString is a seeded FNV-1a variant kept in unsigned arithmetic so browser results are reproducible, and bloomPositions derives k positions with double hashing. The simulator reports both the theoretical false-positive rate and the measured rate over absent queries, so you see the formula meet reality as the bit array fills. The Cuckoo half shows kick chains step by step — evicted fingerprints bouncing between alternate buckets until they settle or the table fails.
| Structure | Cost of membership | Failure mode |
|---|---|---|
| Bloom filter | k hashes, m bits | False positives, never false negatives |
| Cuckoo filter | 2 buckets + kicks | Insert can fail when full |
| B-tree | log-order splits | Slower only if order is tiny |
createBTree builds classic B-trees or B+ variants with configurable max keys; classic splits promote the median upward, while B+ leaf splits copy the first right-leaf key up and link the leaves, B+ leaves stay linked for range scans, and searchBTree records the node-id path so you can see exactly how many hops a lookup costs. Try inserting sorted keys with max keys 2 versus 4 — the split frequency difference explains why real databases pick wide nodes.
Geometry and search: hulls plus backtracking
grahamScan sorts points by polar angle around the lowest pivot, then keeps only left turns using the cross product — right turns and collinear interior points are rejected with a recorded reason at every step. jarvisMarch wraps the set one gift-wrap step at a time instead. Running both on the same point cloud shows why Graham scan wins asymptotically while Jarvis march is intuitive to trace. On the search side, solveSudoku picks the empty cell with the fewest candidates (minimum-remaining-values) before branching, counting assignments, backtracks, and nodes so you can feel MRV pruning versus naive order. solveNQueens reports placements and the first solution alongside backtrack counts — bump N from 4 to 8 and watch the node count tell the complexity story.
Try Them
- FSM & Turing Machine Simulator — trace DFAs and run tape machines step by step.
- Bloom & Cuckoo Filter Simulator — experiment with false-positive rates and kick chains.
- B-Tree Index Visualizer — watch splits, search paths, and B+ leaf links.
- Convex Hull Visualizer — Graham scan versus Jarvis march on your points.
- Backtracking Solver Lab — Sudoku with MRV pruning and N-Queens counting.