Header Ads

Header ADS

What is memoization?


 


Memoization is a programming technique that attempts to increase a function’s performance by caching its previously computed results. Each time a memoized function is called, its parameters are used to index the cache. If the data is present, it can be returned, without executing the entire function. Otherwise, the function is performed and then the result is added to the cache. Let's take the example of adding a function with memoization.


No comments

Powered by Blogger.