Skip to content

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.

Where the book teaches it

Related terms

static local variabletop-down