
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Dynamic programming stores results to reduce execution time and solves a complex problem by dividing it into smaller subproblems, as shown by calculating the factorial of five.
Explore dynamic programming as a design technique to solve problems by breaking a complex problem into simpler, overlapping subproblems and using memoization to store intermediate results and optimize recursion.
Explore intuitive dynamic programming through the Fibonacci series, uncovering base cases, recurrence, and how storing results avoids exponential recomputation.
Apply dynamic programming to compute the Fibonacci series in C++ using an array to store subproblem results, initialize base cases, and build dp values to the final result.
Learn to implement the zero-one knapsack using dynamic programming in C++, building a two-dimensional DP table, handling cases, weights, and values to maximize profit.
Solve the frog staircase to heaven with dynamic programming, using a bottom-up array. Base cases: height zero and height one have one way each; ways(n)=ways(n-1)+ways(n-2).
Solve the grid walking problem with dynamic programming by breaking it into subproblems and filling a two-dimensional dp matrix; count paths by adding right and down moves with base cases.
Master the coin change problem via dynamic programming, relate it to the knapsack problem, and count ways to make an amount using unlimited coins from zero upward.
Explore solving the coin change making problem with dynamic programming by building a dp table, handling base cases, and counting ways with and without each coin.
Apply a dynamic programming approach to compute cumulative sums and answer range sum queries without updates in constant time after preprocessing the array.
Explore dynamic programming to answer range sum queries without updates by building a prefix sum DP, handling base cases and computing sums up to indices for range queries.
Welcome to my course on 'Dynamic Programming for Solving Problems'
This course is specifically designed for those who have started Programming a few months ago. You are expected to know the basics of Programming like Conditional Statements, Loops etc. just to understand the implementation part. Yet, It is not going to be an integral part. Understanding the approach of Dynamic Programming will be our primary focus. We will be implementing the algorithm we have derived, in C++.
The problems that we will be solving in this course are:
1. 0-1 Knapsack Problem (A Complete Explanation having a 1 hour video)
2. Fibonacci Series using Dynamic Programming
3. Longest Common Subsequence Problem
4. Frog's Staircase to Heaven
5. Grid Walking Problem
6. Stock Buy Sell Problem
7. The Coin Change Problem
8. Range Sum Making Queries without updates.
Dynamic programming is both a mathematical optimization method and a computer programming method. If sub-problems can be nested recursively inside larger problems, so that dynamic programming methods are applicable, then there is a relation between the value of the larger problem and the values of the sub-problems. In the optimization literature this relationship is called the Bellman equation.
There are two ways in which we can apply the paradigm of Dynamic Programming:
1. Top down Approach
2. Bottom up Approach
What are you waiting for? Start Learning the course now!
[UPDATE - 13th of July, 2025] - Added the House Robber Problem (Interview Question)
[UPDATE - 13th of July, 2025] - Added one coding exercise (Interview Question)