Added Memoization

Hi,

Added implementation for [memoization](http://en.wikipedia.org/wiki/Memoization).

Regards,
Roland.