Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- virtual void display() const = 0;
- to QueueInterface, add the declaration
- void display() const;
- to the class declaration in the header file, and add the following method definition to the implementation file:
- template<class ItemType>
- void LinkedQueue<ItemType>::display() const
- {
- Node<ItemType>* curPtr = frontPtr;
- while (curPtr != backPtr)
- {
- cout << curPtr->getItem() << " "; // Display items on same line
- curPtr = curPtr->getNext();
- } // end while
- cout << backPtr->getItem() << " "; // Display last item
- cout << endl; // Terminate output with an end of line
- } // end display
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement