Skip to content

Glossary: Algorithms Beyond the Basics in JavaScript

Memoization

Also written: memoize, memo, memoizing

Saving each answer the first time you work it out, usually in a Map, so a repeated call is just a lookup. It cuts `ways(30)` from about 2.7 million calls to 59.

Where the book teaches it

Related terms

Top-downOverlapping subproblemsClosure