next up previous contents
Next: Driver programs Up: Heap lab users guide Previous: How to move heaplab

How to add a new heap implementation

The steps needed to add a new heap implementation are

If you are writing a heap as a priority queue, the file basic/heapsort.cc can be used to turn it into a heapsort for testing purposes. Otherwise if you are writing a heapsort directly you can use it as a model for the interface to the driver programs. The driver programs expects that heap implementations are named heap.cc while heapsort implementations must be named heapsort.cc. A heap must be implemented as a class template named heap taking two parameters. The first parameter specifies the element type, while the second parameter specifies the ordering relation.

A heapsort implementation is similar except that it must be named HeapSort.





Jesper Bojesen
Wed Nov 4 15:35:15 MET 1998