[WPI]
[cs2223]
[cs2223 text]
[News]
[Syllabus]
[Problems]
[Problem 2]
cs2223, D97/98 Problem 2 Solution
Note: The code in these files has been tested on the WPI CCC alpha systems. Hovever, the script files for
these problems were made using a different computer system because of the quantity of computation time
required for problems 2_3 and 2_4.
Problem 2_1
A program which performs heap operations is contained in the CCC directory
/cs/cs2223/problems/problem2/problem2_1
A
README
file explains how the program works and what is printed out. The "best" caase operations  when
the smallest number is the one added, the largest number is the one being deleted, and when the array is
already sorted in inverse order (largest values first), take no swaps. The "worst" cases take the numbers of
swaps we discussed in
Class 9
.
Problem 2_2
A program which implements the greedy chagemaking program is contained in the CCC directory
/cs/cs2223/problems/problem2/problem2_2
A
README
file explains how the program works and what is printed out. Two data files with coin
denominations up to 100.00 were used:
•
us.dat
is the standard US coin system
•
wpi.dat
uses nonstandard coin values and does not contain a coin of value 0.01 so not all values of
change can be made with this system.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '05
 RUIZ
 Algorithms, Multiplication, Numerical digit, Divide and conquer algorithm, README file, CCC directory

Click to edit the document details