Glossary: Algorithms Beyond the Basics in Java
overlapping subproblems
The same smaller question being asked many times, as when `ways(29)` asks for `ways(28)` again. It is what makes plain recursion slow and memoization worthwhile.
Glossary: Algorithms Beyond the Basics in Java
The same smaller question being asked many times, as when `ways(29)` asks for `ways(28)` again. It is what makes plain recursion slow and memoization worthwhile.