Glossary: Algorithms Beyond the Basics in C++
Memoization
Also written: memo, memoize
Saving each answer the first time you work it out, so a repeated call is just a lookup. It cut `ways(30)` from 2.7 million calls to 59.
Glossary: Algorithms Beyond the Basics in C++
Also written: memo, memoize
Saving each answer the first time you work it out, so a repeated call is just a lookup. It cut `ways(30)` from 2.7 million calls to 59.