//------------------------------------------------------------ // Example program to demonstrate que with dynamic // array creation // // L.Aamodt // 5/12/14 que_demo //------------------------------------------------------------ #include #include using namespace std; const int DEFAULT_QUE_SIZE = 10; class que // Class definition { public: que(); // Default constructor que(int size); bool empty(); void enqueue(int value); int dequeue(); int size(); void display(); private: // Data int head; int tail; int queArraySize; int *queArray; }; que::que() // Default constructor { queArray = new int [DEFAULT_QUE_SIZE]; // array size hard coded queArraySize = DEFAULT_QUE_SIZE; head = 0; tail = 0; } que::que(int size) { queArray = new int [size]; // array size hard coded queArraySize = size; head = 0; // points to last item placed in queue tail = 0; // points to first (oldest) item in queue } void que::enqueue (int value) // Place another item in the queue { } int que::dequeue() // Remove top item from stack { int qdata = 0; return qdata; } int que::size() // Get the number of items on the stack { } void que::display() // Print stack contents { } int main() // Test the stack functions { que que1; int i; for (i=0; i<8; i++) { que1.enqueue(i*10); } que1.display(); return 0; }