Algorithms and Data Structures · Junior · Question 29 of 75
What is memoization?
- ✓Correct answer: Caching results by arguments so repeat calls are instant
- 2Freeing memory that the function no longer needs
- 3Rewriting a function so that it uses less RAM
Explanation
A memoized function stores results in a cache keyed by its arguments. It only works correctly for pure functions, whose result depends only on their arguments.