If a priority queue is implemented as a binary search tree instead of a heap, the member function defined in PQType would not change, but the private data members defined in PQType would change. The only data member would be a pointer to a Tree Node
TreeNode * items;
Complete the dequeue operation, using this implementation.
template
void PQType :: Dequeue (ItemType& item)
//Pre: Priority queue is not empty.
//Post: The rightmost node is returned.



Answer :

Other Questions