/dp

Dynamic Programming for Beginners

Primary LanguageGo

Dynamic Programming For Beginners

Solutions to the problems from the course: https://www.youtube.com/channel/UClnwNEngsXoIp_tgJ2jZWfw

Lecture 1 Notes

Introduction

Lecture 2 Notes

Dynamic Programming Properties

  • Optimal Substructure
  • Overlapping subproblems

Optimal Substructure

To solve a structure we can leverage the substructure.

Overlapping Subproblems

Easy example is fibonaci. To solve fibonaci(n) we just need to use fibonaci(n-1) + fibonaci(n-2).

Lecture 3 Notes

Dynamic programming can solve these two types of problems:

  • Combinatoric problems: answer how many
  • Optimization probelm: maximize/minimize

Lecture 4 Notes

  1. Define objective function
  2. Identifying the base cases
  3. Recurrence relation
  4. Order of computation
  5. Location of the answer