Algorithms

Dynamic programming

A strategy that splits a problem into subproblems that repeat and stores each one's solution so it is never computed twice.

Example

Fibonacci of 40 with plain recursion makes over 300 million calls; storing each result, it takes 40 steps.

Test yourself: Dynamic programming

Dynamic programming

Climbing 1 or 2 stairs at a time, a 3-stair staircase can be climbed in ___ ways.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.