[an error occurred while processing this directive]
In this sub-project, you will implement one class:
A queue stores objects in an ordered list and allows insertions at one end and deletions from the other end of the list in Θ(1) time.
The objects in this queue are stored in a fixed-capacity array.
The run time of each member function is specified in parentheses at the end of the description. Projects which do not satisfy the run time requirements will be required to resubmit.
A class which implements a queue using an array. For run-time requirements, the number of objects in the queue is n.
The class at least six suggested member variables:
You may chose to use these or use whatever other member variables you want.
Queue( int n = 10 )
The constructor takes as an argument the capacity of the array and allocates memory for that array. If the argument is either 0 or a negative integer, set the initial capacity of the array to 1. The default initial capacity is 10. Other member variables are assigned as appropriate.
~Queue()
The destructor deletes the memory allocated for the array.
Queue( Queue const & )
The copy constructor creates a new instance of the queue. (O(n))
This class has four accessors:
This class has three mutators:
The class has one friend: the operation cout << queue. Because the structure of the internal queue is unknown, nothing is implemented here; however, you could add an implementation which allows you to print the entries of your queue.