Implementation of standard problems using dynamic programming paradigm