Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
Cinjection
Oleksi Derkatch
Send A Message
Rating
Not
Rated
Please login to rate source codes.

Click here to register a free account with us.
General Details
Ruby
Posted 97 Days Ago
430 Views
Received 0 Ratings
More Codes By This Author
MD5 Brute-Forcer
Number of ways to make ch...
SPS Desktop Changer
Simple program using GUI...
Genetic Algorithm for sol...
Articles By This Author
Intorduction to memoizati...
Strings in C++
Vectors in C++
Use Cases
[C++] Pointers and their...

Number of ways to make change using Memoization


Description
This is a program I made to solve the following challenge:
"Given the a list of coin amounts, and a final amount, your program should calculate how many different ways there are to make change for the final amount using the various coins.

Your program should input:
1) The final sum
2) The number of different coins
3) The various coins

You can gather this information in any way you want.

There should always be a 0.01 coin to ensure all possible amounts can be changed. Therefore, there should always be at least one kind of coin."
http://www.newgrounds.com/bbs/topic/959858


This particular solution uses memorization(remembering previous calculations for when you need them) to calculate the result fairly quickly.
Technical
Sample run:
Amount to change: 1.00
Number of coins: 5
Coin 1: 0.01
Coin 2: 0.05
Coin 3: 0.10
Coin 4: 0.25
Coin 5: 0.50
There are 292 different ways to make change for $1.0
Source Code
Comments
Please login to post comments.
Page 1 of 1
More "Ruby" Source Codes By This Author
Recently Posted "Ruby" Source Codes
Recently Rated "Ruby" Source Codes
 
 
Latest News About Coder Profile
Coder Profile Poll
What is the next application you would like to be added to your profiles?

Books
Coding Challenges
Project Management
Blog
Tutorials


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
5 Days Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved