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()

Doxygen for pop().

peek()

Doxygen for peek().

push()

Doxygen for push().

empty()

Doxygen for empty().

root()

Doxygen for root().

leftChild()

Doxygen for leftChild().

rightChild()

Doxygen for rightChild().

parent()

Doxygen for parent().

hasAChild()

Doxygen for hasAChild().

maxPriorityChild()

Doxygen for maxPriorityChild().

heapifyDown()

Doxygen for 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:

If you modify any other files, they will not be grabbed for grading and you may end up with a “stupid zero.”