// Chap 11, pp 543 - 544 // Rename this file as PQ.cpp. // ********************************************************* // Implementation file PQ.cpp for the ADT Priority Queue. // A heap represents the priority queue. // ********************************************************* #include "PQ.h" // header file for priority queue pqClass::pqClass() { } // end constructor // NOTE. THE NEXT 3 LINES ARE MISSING FROM THE TEXT: pqClass::pqClass(const pqClass& PQ) : H(PQ.H) { } // end copy constructor pqClass::~pqClass() { } // end destructor boolean pqClass::PQueueIsEmpty() { return H.HeapIsEmpty(); } // end PQueueIsEmpty void pqClass::PQueueAdd(pqItemType NewItem, boolean& Success) { H.HeapAdd(NewItem, Success); } // end PQueueAdd void pqClass::PQueueRemove(pqItemType& PriorityItem, boolean& Success) { H.HeapRemove(PriorityItem, Success); } // end PQueueRemove // End of implementation file.