Glossary: Algorithms Beyond the Basics
Memoization
Also written: memo, memoize
Saving each answer the first time you work it out, then looking it up when the same question comes again. It cut `ways(30)` from 2.7 million calls to 59.
Glossary: Algorithms Beyond the Basics
Also written: memo, memoize
Saving each answer the first time you work it out, then looking it up when the same question comes again. It cut `ways(30)` from 2.7 million calls to 59.