solution02

solution02 - [WPI] [cs2223] [cs2223 text] [News] [Syllabus]...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
[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 chage-making 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 non-standard coin values and does not contain a coin of value 0.01 so not all values of change can be made with this system. Note that the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/10/2009 for the course CS 2223 taught by Professor Ruiz during the Fall '05 term at WPI.

Page1 / 3

solution02 - [WPI] [cs2223] [cs2223 text] [News] [Syllabus]...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online