Index

Module 09 · DSABuilt from the toolbox

Build a diff: the table

Recursion and Dynamic Programming
Recursion and Dynamic Programming · Open board

Is the board this build leans on. It says dynamic programming is “just recursion that remembers”: answer each small question once, write it down, and build the big answer from answers already written. This lesson writes those answers into a grid for two whole files, turns the grid into a real diff, and then measures how much writing everything down costs.

Before you start. Dynamic Programming, Worked (filling the table) filled a grid for two protein chains: each cell answered “how much do these two beginnings share, in order?”, and the answer for the whole chains waited in the bottom-right cell. Clinic #22 - Longest Common Subsequence solved the same grid as an interview problem, and Git's diff (Myers' algorithm) - the case study, later in this track, tells git’s side; here you build the tool yourself, one file of Python, and watch it run out of room.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Review DSA →

Saved in this browser, and to your account when you sign in.