Slide 1Dynamic Programming Prof. Muhammad Saeed Slide 2 Dynamic programming like the divide and conquer method, solves problem by combining the solutions of sub problems…