Getting Started

Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of subproblems, so that we do not have to re-compute them when needed later. This simple optimization reduces time complexities from exponential to polynomial.


Topics:

Basic Concepts:

  1. What is memoization? A Complete tutorial
  2. Introduction to Dynamic Programming – Data Structures and Algorithm Tutorials
  3. Tabulation vs Memoizatation
  4. Optimal Substructure Property
  5. Overlapping Subproblems Property
  6. How to solve a Dynamic Programming Problem ?

Advanced Concepts:

  1. Bitmasking and Dynamic Programming | Set 1
  2. Bitmasking and Dynamic Programming | Set-2 (TSP)
  3. Digit DP | Introduction
  4. Sum over Subsets | Dynamic Programming

Standard problems on Dynamic Programming:

Quick Links :

  1. Learn Data Structure and Algorithms | DSA Tutorial
  2. Top 20 Dynamic Programming Interview Questions
  3. ‘Practice Problems’ on Dynamic Programming
  4. ‘Quiz’ on Dynamic Programming
"Dynamic programming: where we play the game of 'connect the dots' with code, hoping the final picture makes sense... and doesn't look like a tangled spaghetti dish!"

Reference books:

  • "Introduction to Algorithms" by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein
  • "Algorithm Design" by Jon Kleinberg and Éva Tardos
  • "Dynamic Programming for Coding Interviews" by Meenakshi and Kamal Rawat
  • "Algorithms" by Robert Sedgewick and Kevin Wayne
  • "Elements of Programming Interviews in Python/C++" by Adnan Aziz, Tsung-Hsien Lee, and Amit Prakash