Memoization Strategy

Memoization is a strategy to implicitly save the value of a computation in order to produce that same value later without evaluating the computation more than once.

SchemeLanguage, OcamlLanguage, and SmlNjLanguage provide ExplicitLazyProgramming and use memoization in the implementation. Other functional languages like HaskellLanguage are implicitly lazy and provide explicit strict constructs to eagerly evaluate an expression.

See

The point of memoization is to trade time for space. Classic examples where memoization is very useful are functions to calculate factorials or the Fibonacci sequence. Especially if you're memoizing a recursive function.

A slightly more formal definition is that a memoization function takes a function f and returns a function fm that is the same as f except it uses a cache.

-- AdewaleOshineye, PatrickLogan, et al.


See also: MemoizationInPython, FactorCache, CacheCalculations


Category FunctionalProgramming


EditText of this page (last edited August 22, 2008) or FindPage with title or text search