Add a implementation of dynamic programming

Add a implementation of dynamic programming  algorithms for various
problems