This is the example used in my blogpost Understanding Dynamic Programming, published in Towards Data Science, the top data science publication on Medium.
The post discusses:
- Dynamic Programming in general
- Approaching a dynamic programming problem
- An example solved with an inefficient resursive approach and later improved
The code here is the final result that is achieved in the article.
You'll find a few txt files containing pseudocode for the various approaches used in the post. They're named accordingly.
There's also a c++ file containing the code for the final most efficient approach explained in the post.
- Clone this repo
- Navigate to this directory
- Setup C++ locally if it isn't already set up.
Simply execute:
$ git clone https://github.com/Polaris000/BlogCode.git
$ cd DynamicProgramming
$ cpp constant_space_bottom_up.cpp
You can find me on medium here.