O'Reilly logo

Learning Functional Data Structures and Algorithms by Raju Kumar Mishra, Atul Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Memoization - remembering past results

Memoization is the art of computer program optimization to speed up functions. Donald Michie coined the word memoization. Whenever, a memoized function is called for the first time, for a given input, its output value is calculated and cached. Next time when the same input is given as an argument, function does not compute the value but returns the value from cached location for that given input. In some programming language, we find some or other internal mechanism to implement memoization. But many programming languages require explicit work to implement memoization.

So, is it possible that a function can return different output for the same input? The answer is: this is possible. We can understand this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required