Posts

Showing posts with the label Circular Queue

Circular Queue

/*  * pshrestha_a3.cpp  *  *  Created on: Nov 16, 2010  *      Program Description:  *      A class is written that implements a "Circular Queue" data structure for storing  *      and retrieving floating point values. The methods created are: Enqueue(), Dequeue(),  *      isEmpty(), isFull(), makeEmpty(), goToHead().  *     A switch statement is used in the main program for the efficiency of its application  *     to handle the structured data.  */ #include <iostream> #include <cctype> #include <iomanip> using namespace std; const int MAX_ELEMENTS = 17; // Declaring maximum number of elements. struct Float_Node { // Structure for the node containing a value and the next node. double Value; struct Float_Node* Next; }; class CircularQueue { private: Float_Node *rear; Float_Node *p; // Current int no...