Assignment #1 - Computer Programming II | CS 122, Assignments of Computer Science

Material Type: Assignment; Class: Computer Programming II; Subject: Computer Science; University: Pace University-New York; Term: Spring 2006;

Typology: Assignments

Pre 2010

Uploaded on 08/09/2009

koofers-user-4jf-1
koofers-user-4jf-1 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CRN: 22430/21519 Pace University Spring 2006
CS122/504 Computer Programming II
Assignment 1
Assigned on February 7, 2006
Due on February 21, 2006
1. Design and implement a class named PriorityQueue based on an array of integers. The class
should support the following methods:
a. public void insert(int value); // insert integer value into the priority queue
b. public int delete(); // delete and return any largest value in the queue
c. public boolean isEmpty(); // return true iff the queue is empty
The number of integers that can be inserted into the priority queue should only be limited by
the capacity of your computer’s memory system.
2. Write a class TestPriorityQueue to test out your class PriorityQueue. You can insert 100
random integers into a PriorityQueue object and then delete and print out all of them to see
whether the integers are printed in decreasing order.
The assignment is also posted in forum Assignments inside Discussion Board of CS122/504
Blackboard. Submit a single zip file of all of your completed source code files as an attachment to your
reply to my assignment 1 thread.
Please add assignment name, your name, your assignment completion date, and the above assignment
problem description as comments at the beginning of your source code.
Please make sure that your program works correctly, and the source code is formatted properly with
proper column alignment and line indentation. Add necessary concise comments to your tricky points
for helping readers understand your program. There will be penalties for lacking necessary comments
or improper code alignment or indentation.

Partial preview of the text

Download Assignment #1 - Computer Programming II | CS 122 and more Assignments Computer Science in PDF only on Docsity!

CRN: 22430/21519 Pace University Spring 2006

CS122/504 Computer Programming II

Assignment 1

Assigned on February 7, 2006 Due on February 21, 2006

  1. Design and implement a class named PriorityQueue based on an array of integers. The class should support the following methods:

a. public void insert(int value); // insert integer value into the priority queue b. public int delete(); // delete and return any largest value in the queue c. public boolean isEmpty(); // return true iff the queue is empty

The number of integers that can be inserted into the priority queue should only be limited by the capacity of your computer’s memory system.

  1. Write a class TestPriorityQueue to test out your class PriorityQueue. You can insert 100 random integers into a PriorityQueue object and then delete and print out all of them to see whether the integers are printed in decreasing order.

The assignment is also posted in forum Assignments inside Discussion Board of CS122/ Blackboard. Submit a single zip file of all of your completed source code files as an attachment to your reply to my assignment 1 thread.

Please add assignment name, your name, your assignment completion date, and the above assignment problem description as comments at the beginning of your source code.

Please make sure that your program works correctly, and the source code is formatted properly with proper column alignment and line indentation. Add necessary concise comments to your tricky points for helping readers understand your program. There will be penalties for lacking necessary comments or improper code alignment or indentation.