# Asking the Same Question Twice: Memoization

Speed up a recursive function that answers 10 stairs at once, 40 in half a minute and 50 in about an hour: why a faster computer and a loop with your own stack don't help, where the time really goes, and how writing each answer down, memoization, makes it instant.

![Cheat sheet: Asking the Same Question Twice: Memoization](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/b6a80c24d9eb43458eb06ac5faa569a2.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: data structures, Dynamic Programming, Exponential Time, Memoization (data-structures)
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/ds-memoization-cheat-sheet
