Complete Guide to Dynamic Programming

In this complete guide to Dynamic Programming, you will learn about the basics of Dynamic Programming, how to get started with Dynamic Programming, learning, strategy, resources, problems, and much more.

Discover a smoother learning journey through our effortless roadmap

Chapters

Getting Started with Dynamic Programming

Dynamic Programming (DP) Tutorial with Problems

What is memoization? A Complete tutorial

Overlapping Subproblems Property in Dynamic Programming | DP-1

Optimal Substructure Property in Dynamic Programming | DP-2

Steps for how to solve a Dynamic Programming Problem

Dynamic Programming Vs Other Algorithms

Tabulation vs Memoization

Greedy Approach vs Dynamic programming

Comparison among Greedy, Divide and Conquer and Dynamic Programming algorithm

Easy Problems on Dynamic Programming

Nth Fibonacci Number

Program for factorial of a number

Coin Change - Count Ways to Make Sum

Longest Common Subsequence (LCS)

Longest Increasing Subsequence (LIS)

Maximum Subarray Sum - Kadane's Algorithm

0/1 Knapsack Problem

Unbounded Knapsack (Repetition of items allowed)

Medium Problems on Dynamic Programming

Maximum sum rectangle in a 2D matrix | DP-27

Maximum size square sub-matrix with all 1s

Longest Palindromic Subsequence (LPS)

Longest Palindromic Substring

Longest Common Increasing Subsequence (LCS + LIS)

Shortest Common Supersequence

Maximum Product Subarray

Egg Dropping Puzzle | DP-11

Partition a Set into Two Subsets of Equal Sum

Word Break Problem | DP-32 | Set - 2

Box Stacking Problem | DP-22

Floyd Warshall Algorithm

Hard Problems on Dynamic Programming

Longest Bitonic Subsequence | DP-15

Word Wrap Problem

The Painter's Partition Problem

Matrix Chain Multiplication

Best Time to Buy and Sell Stock IV (at most k transactions allowed)

Maximum size rectangle binary sub-matrix with all 1s

Count Distinct Subsequences

Wildcard Pattern Matching

Travelling Salesman Problem using Dynamic Programming

Longest Increasing Path in Matrix

Longest Zig-Zag Subsequence

Dynamic Programming on Tree

Introduction to Dynamic Programming on Trees

Maximum height of Tree when any Node can be considered as Root

DP on Trees | Set-3 ( Diameter of N-ary Tree )

Maximal Point Path

Maximum Path sum in a N-ary Tree

Bitmasking in Dynamic Programming

Count Ways To Assign Unique Cap To Every Person

Bitmasking and Dynamic Programming | Travelling Salesman Problem

Partition of a set into K subsets with equal sum using BitMask and DP

Digit Dynamic Programming

Digit DP | Introduction

Longest subsequence such that adjacent elements have at least one common digit

Count of N digit numbers which contains all single digit primes

Count of N-digit numbers with at least one digit repeating

Count numbers from a given range whose product of digits is K

Count numbers in range [L, R] having K consecutive set bits

Count the numbers with N digits and whose suffix is divisible by K

Count of integers from the range [0, N] whose digit sum is a multiple of K

Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime

Count numbers in given range such that sum of even digits is greater than sum of odd digits

Quiz on Dynamic Programming

Top MCQs on Dynamic Programming with Answers

About the Complete Guide to Dynamic Programming

Our Complete Guide to Dynamic Programming offers a comprehensive overview of this powerful problem-solving technique. Whether you're an experienced coder looking to enhance your skills or a beginner aiming to master this essential concept, this guide equips you with the knowledge and tools to efficiently solve complex problems by breaking them down into manageable subproblems.

Basic Terminologies of Dynamic Programming

While learning about Dynamic Programming in this Complete Guide on Dynamic Programming, you will come across some common terms that will be used multiple times. Some of these terms are:

  1. Optimal Substructure: Problems can be solved using solutions to their subproblems.
  2. Overlapping Subproblems: Some subproblems are solved repeatedly.
  3. Memoization: Caching and reusing computed results.
  4. Tabulation: Building solutions iteratively in a table.
  5. State: Parameters defining a subproblem.
  6. Recurrence Relation: Mathematical equation for problem-solving.
  7. Top-Down: Recursive approach, starting with the main problem.
  8. Bottom-Up: Iterative approach, solving simple subproblems first.
  9. State Space: All possible states in a problem.
  10. Optimal Solution: The best solution to the original problem.

Why Dynamic Programming is needed?

Dynamic Programming is needed to efficiently solve complex problems by breaking them into smaller, solvable subproblems, saving time and resources in finding optimal solutions.