CS 14 - Lab


CS 14 Homepage

Array Implementation of a Binary Heap (and experience with pointers)

In this lab you will be implementing a max heap (the highest number will be the root). You will be simulating a print queue and each print job will be represented as a class called PrintJob. You must implement the enqueue, dequeue, print, and highest functions for your heap class and various functions for the PrintJobs class. Your heap will be implemented as a dynamically allocated array of print job pointers (this will perhaps give you an experience with pointers that you have not yet had).

Provided files

Point Breakdown For Lab Assignment

You will demo your binary heap in lab. The TA will look at the output of main.cc to verify that your heap works. (You will need to download a fresh copy of main.cc while the TA is watching) The TA will then verify that you did indeed write the code to do this. Remember, to receive credit for this lab, you MUST turn the code in online as well as demo in lab, however, you will only receive points for what you demo to the TA during lab section. If you do not turn in your code online, you will lose points for your lab. All code must be turned in online for archival purposes.

© 2003 UC Riverside Department of Computer Science & Engineering. All rights reserved.