lab_heaps Precarious Priority-Queues
Due:
- Sunday, April 23 at 11:59 PM 4/23 @ 11:59 PM
Assignment Description
In this lab you will write some heap functions.
Checking Out The Code
Get the code in the usual way.
Check out the Doxygen for provided files.
Constructors
Doxygen for building an empty heap. Doxygen for building a heap.
pop()
peek()
push()
empty()
root()
leftChild()
rightChild()
parent()
hasAChild()
maxPriorityChild()
Doxygen for maxPriorityChild()
.
heapifyDown()
heapifyUp()
We have written this for you as an example: Doxygen for heapifyUp()
.
Testing Your Code
You can test your implementation by running:
./testheap // Runs testheap. You can diff the output with soln_testheap.out
./testheap color // colorizes the output of testheap (green for correct output
// red for incorrect output, or red underlines for missing output)
./testheap > out.txt // Redirects the output to the file "out.txt" so you can diff it with soln_testheap.out
./testheap 10000 // Tests your heap with 10000 items instead of the default 15
Grading Information
The following files (and ONLY those files!!) are used for grading this lab:
heap.cpp
heap.h
If you modify any other files, they will not be grabbed for grading and you may end up with a “stupid zero.”