|
Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Minimum coins change problem is a problem used to find the minimum number of coins required to completely reach a target amount. More...
#include <iostream>#include <vector>#include <cassert>#include <climits>Namespaces | |
| dynamic_programming | |
| Dynamic Programming algorithms. | |
| mincoins_topdown | |
| Functions for minimum coin exchange problem. | |
Functions | |
| template<typename T > | |
| int64_t | dynamic_programming::mincoins_topdown::mincoins (const T &n, const std::vector< T > &coins, const int16_t &t, std::vector< T > dp) |
| This implementation is for finding minimum number of coins . More... | |
| static void | test () |
| Test implementations. More... | |
| int | main () |
| Main function. More... | |
Minimum coins change problem is a problem used to find the minimum number of coins required to completely reach a target amount.
This problem can be solved using 2 methods:
| int main | ( | void | ) |
Main function.
| int64_t dynamic_programming::mincoins_topdown::mincoins | ( | const T & | n, |
| const std::vector< T > & | coins, | ||
| const int16_t & | t, | ||
| std::vector< T > | dp | ||
| ) |
This implementation is for finding minimum number of coins .
| T | template-type to use any kind of value |
| n | amount to be reached |
| coins | vector of coins |
| t | deontes the number of coins |
| dp | initilised to 0 |
|
static |
Test implementations.