This repository presents a small algorithm study of the classic Coin Change problem, implemented in Python π.
Problem statement:
Given a set of coin denominations and a target amount, determine the
minimum number of coins needed to make that amount.
If it is not possible to form the amount using the given coins, return-1.
The goal of this repo is to compare two different approaches to solving this problem:
- π§ͺ Naive recursive solution β
algorithm1.py - βοΈ Optimized dynamic-programming solution β
algorithm2.py
The code is kept clean and minimal so that the focus stays on the core idea of each algorithm.
algorithm1.pyβ naive recursive solutionalgorithm2.pyβ optimized dynamic-programming solutionCoin_Change_Algorithms_Report.pdfβ full detailed report, including:- formal problem definition and examples
- pseudocode for both algorithms
- time and space complexity analysis
- experimental results, tables, and graphs π
- discussion and conclusions
This README only gives a high-level overview.
For all explanations, proofs, measurements, and graphs,
please refer to the PDF report:
Coin_Change_Algorithms_Report.pdf β