//Copyright (c) 1996 A. Michael Berman. All Rights Reserved. //This code is from "Data Structures via C++: Objects by Evolution", to be //published by Oxford University Press USA. Permission is hearby granted to //use this code for any educational, non-commercial purpose, provided this //notice remains intact. //A. Michael Berman, Rowan College of New Jersey, berman@rowan.edu // cx9-2.h // Code Example 9-2: Header File for Queue #ifndef __MB_CX9_2__ #define __MB_CX9_2__ #include "dslib.h" const int maxQueue = 200; template < class queueElementType > class Queue { public: Queue(); void enqueue(queueElementType e); queueElementType dequeue(); queueElementType front(); bool isEmpty(); private: int f; // marks the front of the queue int r; // marks the rear of the queue queueElementType elements[maxQueue]; }; #endif