ADS2 Arcade Algorithms and Data Structures II · 2026/27

Small games for practising the algorithms from the lecture. Notation follows the ALG book. Personal bests are saved in your browser only.

Strings

🏃
KMP · ALG 13.2

Failure Function Sprint

Compute the failure array Z of tricky needles. How many can you get right in 90 seconds?

🌳
Aho–Corasick · ALG 13.3

Where Do I Fail?

Click where the failure and shortcut edges of a trie go. The automaton grows as you answer.

🎲
Rabin–Karp · ALG 13.4

Rolling Hash

Watch the window roll, compute hash updates against the clock, and craft evil haystacks full of spurious hits.

🔬
KMP · ALG 13.2

KMP Playground

Step through KMP search and the construction of Z on your own strings.

🔭
Aho–Corasick · ALG 13.3

Aho–Corasick Playground

Step through AcSearch and AcBuild with your own set of needles.

Flows

🚰
Ford–Fulkerson · ALG 14.1–14.2

Augment!

Find augmenting paths in the residual network, then prove your flow is maximum with a cut. Also has a Dinic mode with layered networks and blocking flows (ALG 14.4).

🎓
bipartite matching · ALG 14.3

Thesis Match

Match students to thesis topics by finding alternating paths, watch the same augmenting path in the flow network, then prove your matching is maximum with a cut.

⛰️
Goldberg · ALG 14.5

Downhill

Push excess downhill and raise vertices when stuck. Heights are positions on the screen.

Parallel algorithms

🔀
sorting networks · ALG 15.3

Comparator Lab

Build sorting networks by hand. Can you match the proven optimum: 19 comparators for n = 8?

➕
parallel addition · ALG 15.2

Carry Lookahead

Compute block behaviors 0 / 1 / < up the tree and carries back down: add two numbers in Θ(log n) rounds instead of n.

Geometry

🍎
convex hull & sweep line · ALG 16.1–16.2

Fence the Orchard

Fence apple trees with a rubber band, then run ConvexHull yourself: left turn or right turn, remove or append? Bonus: sweep line for segment intersections.

Algebraic algorithms

🌀
FFT · ALG 17.1–17.3

Square Dance

Square the roots of unity and watch n points collapse to n/2, then race through butterflies yj = sj ± ωj·ℓj.

Hard problems

🔺
3-SAT → IndSet · ALG 19.2

One per Triangle

Satisfy the formula or pick one vertex per triangle, and watch the reduction translate your answer. Spot the unsatisfiable ones.

🧳
approximation · ALG 19.6

Good Enough

Beat the 2-approximation for the traveling salesman, then pack a knapsack against ApproxKnapsack, and see on your own instance why the guarantees hold.

Slides

📽️
ALG 13.2

Knuth–Morris–Pratt

Search and building the automaton.

📽️
ALG 13.3

Aho–Corasick

Many needles at once.