Skip to content

Glossary: Algorithms Beyond the Basics in JavaScript

Overlapping subproblems

The same smaller question being asked many times inside a bigger problem. Plain recursion for `ways(30)` re-asks `ways(28)` over and over, which is what makes it slow.

Where the book teaches it

Related terms

MemoizationDynamic programmingOptimal substructure