Skip to main content
PProfileMatch
← Path

Dynamic Programming · Dynamic Programming: Overlapping Subproblems and Memoization

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Bike shop: checking the tyres

Trick to keep in mind+3 XP

Same question asked twice? Cache it. Every question unique? Leave it alone.

Memoization only pays when a recursion calls itself with the same arguments more than once. Sketch a tiny call tree and look for two identical nodes. Splitting a list in half, halving a range or walking a tree never repeats an argument, so a cache would just add bookkeeping.

Read it once, then a question tests whether the trick stuck.