optional · interactive figures
A DP table filled cell by cell, and a tree DP climbing from the leaves: both replayed from code checked against the reference solution.
optional: nothing in the lab depends on itback to the slides
16 · explore
Try: step and watch each cell look at the cell above and at the one a weight to the left; the last step reads the answer back. Static version: the knapsack table, filled in.
16 · explore
Try: step up the tree, leaves first, then back down as the cover is read off. Static version: in and out, on a seven-vertex tree.