Algorithms, C++

My dynamic programming journey [2] – Coin change problem

As suggested in both Quora and StackOverflow, the coin change problem should be the second problems for beginner to solve. There are actually multiple variations of this problem, however, my approach will be finishing the basic version first, which is: Given a set of coins with values, find the possible way to form N (order is not considered). Example: Given…

Continue Reading

Algorithms, C++

My dynamic programming journey [1] – Fib with memorization

It is rather complicated to consider the advance level of dynamic programming at the beginning, so I have decided to start with a basic example: finding Fibonacci numbers. Since the concepts of recursion and memorization are often required in dynamic programming, therefore, I have implemented a version of memorization. Set base case of 0 and 1 equal to 1 Check…

Continue Reading