This repository contains solutions for the Coin Change Problem implemented in C++. It includes two approaches:
- A Greedy algorithm-based solution.
- A Dynamic Programming-based solution.
The Coin Change Problem involves finding the minimum number of coins that make up a given amount of money, using coins of specified denominations.
No special installation is required. A C++ compiler is necessary to compile and run the program.
- Compile the C++ code using a C++ compiler.
- Run the executable.
- Input the required sum and the available denominations as prompted.
Input:
- Total Sum: 137
- Denominations: Dollar (100 cents), Quarter (25 cents), Dime (12 cents), Nickel (5 cents), Cent (1 cent)
Output:
- Greedy Algorithm: "Sum can't be constructed for this problem"
- Dynamic Programming: Total denominations used: 5
Feel free to fork this repository and submit pull requests. Please adhere to the existing coding style and add comments where necessary.
This repository contains two implementations for solving the Longest Common Subsequence (LCS) problem: a simple recursive approach and a dynamic programming approach.
No specific installation required. Ensure you have a C++ compiler installed to run the program.
- Compile the C++ code.
- Run the executable.
- Follow the on-screen prompts to enter the sequences.
Input: Sequence 1: "ABCBDAB" Sequence 2: "BDCAB"
Output: LCS Length (Recursive): 4 LCS Length (Dynamic Programming): 4
Contributions to this project are welcome. Please ensure your code adheres to the existing style conventions.