Skip to content

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.

Where the book teaches it

Related terms

@cacheOverlapping subproblemsTop-down