Please wait
Loading technology simulations
The requested content is still loading.
Finished experimenting?
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
Please wait
Loading technology simulations
The requested content is still loading.
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
1dp[i][0] = i; dp[0][j] = j // base2for i in 1..m:3 for j in 1..n:4 if a[j-1] == b[i-1]:5 dp[i][j] = dp[i-1][j-1] // match6 else: dp[i][j] = 1 + min(7 left dp[i][j-1], up dp[i-1][j], diag dp[i-1][j-1])
This edit distance simulator turns the classic dynamic-programming table into something you can watch and do. Each interior cell lights up with arrows to its three dependencies — left (insert), up (delete), diagonal (match or replace) — and the readout explains whether the letters match (copy the diagonal) or cost 1 + the cheapest neighbor. When the table completes, the optimal alignment path glows gold from the bottom-right answer back to the origin, showing exactly which edits transform one word into the other. The signature interaction: Fill-It-Yourself mode asks you to type each cell's value from its neighbors with instant feedback and a streak counter — active recall of the recurrence instead of passive watching. A work-to-solve card contrasts the naive recursion's exponential call count with the table's m·n cells, and both strings are editable so you can compute the distance between any two words.
edit distance · levenshtein distance · dynamic programming · DP table · optimal substructure · backtrace alignment · string algorithms
Browse all Technology simulations →
Free to use in your browser — no signup required. Found a bug or have an idea to make it better? Tell us.