Skip to content

vasilopo/Change-Making-Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change Making Problem

Change-making is a simple Dynamic Programming problem.

Dependencies

In order to run this program you need the python3 yaml library, which can be installed by running the following command:

pip3 install pyyaml

Algorithm Logic

This approach is a BFS (Breadth First Search) on a Tree containing all the available combinations.

Use

In order to run the program use git clone and then edit the following variables of the conf.yaml file:

change: 111
available_coins: [2, 5, 10, 20]
timer: True

change: is the desired amount

available_coins: handles the coins that can be used in order to return the desired amount

timer: handles the code which prints the execution time of the program

Run

You execute the program by typing the following command:

python3 main.py

Tests with Pytest Library

To install the pytest library run the following command:

pip3 install pytest

In order to run the tests, navigate to the tests folder and then run the following command:

pytest test_CoinClass.py -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License.

About

This is an BFS (Breadth-First-Search) approach to the Change-Making problem.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages