CS215queue(3o5)

CS215queue(3o5) - // Post: newItem is at rear of queue....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #ifndef CS215QUEUEL #define CS215QUEUEL #include "nodetype.h" #include <iostream> class CS215queue { public: CS215queue( ) // CONSTRUCTOR ~CS215queue( ) // DESTRUCTOR // Is Empty: Returns true if queue empty // Pre: queue exsists // Post: return true if elements in queue bool IsEmpty( ) const b // isFull: Returns true if queue full // Pre: queue exsists // Post: Always return true // Linked list queue cannot be full bool IsFull( ) const // Enqueue: Adds newItem to the rear of the queue. // Pre: Queue has been initialized. // Queue is not full. // newItem is elemnet to add to queue
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Post: newItem is at rear of queue. void Enqueue( int item ) // Dequeue: Removes element from from front of queue // and returns it in item. // Pre: Queue has been initialized. // Queue is not empty. // Post: Front element has been removed from queue. // item is a copy of removed element. void Dequeue( int& item ) // MakeEmpty: // Post: Queue is empty all elements deallocated. void MakeEmpty( ) // print: Print all queue elements void print() private: NodeType* qFront // Pointer to front of queue NodeType* qRear // Pointer to raar of queue } #endif...
View Full Document

This note was uploaded on 10/13/2008 for the course CS 215 taught by Professor Piwowarski during the Spring '06 term at Kentucky.

Ask a homework question - tutors are online