AlgoScope

Dynamic Programming

ParadigmintermediateParadigms

Solve each overlapping subproblem once and reuse the answer.

Decision · step 2 of 24Recursion Trees: fib(6) with memoization
f(6)call

fib(6) is not a base case and not cached, so it calls fib(5) first and fib(4) after that.

Open in the player →or start at step 2

What you will see

A recursion tree collapsing into a table.

How recursion trees works →

Cost

SpaceO(states)

How you work with it here

play it through, step one change at a time, compare two runs.

Screen readers: Each paradigm lesson is narrated as the characteristic loop it performs; the comparison view is available as a table.

Reduced motion: Side-by-side panes update in place.