Glossary: Algorithms Beyond the Basics in Go
Memoization
Also written: memoize
Saving each answer the first time it is worked out so a repeated call is just a lookup. It turns `ways(30)` from 2.7 million calls into 59.
Glossary: Algorithms Beyond the Basics in Go
Also written: memoize
Saving each answer the first time it is worked out so a repeated call is just a lookup. It turns `ways(30)` from 2.7 million calls into 59.