provides a simple framework for a queue data structure. Implement the details for the operations for this
Question:
provides a simple framework for a queue data structure. Implement the details for the operations for this basic queue data structure that will use an array of elements of type string. We will not use templates for this implementation. Provide the implementations details for the following class methods (i.e. operations): initialize(), empty(), enqueue(string element), dequeue(), and nextElement(). Descriptions of most these methods are provided in the source code and in supplementary module in the Learning Activities area. The code in the Driver.cpp file will remain the same.
Hint: Again, you only need to modify the areas in the Queue.h file by adding the necessary code to implement the TODO areas as noted in the comments. The prototype for the functions and everything else in the program must remain unchanged. You must use the function signature for your implementation.
Output: The output for the program after the functions are implemented should appear as follows:
Queue properties: empty = 1 max size = 20 current size = 0 top element = [None]
Queue properties: empty = 0 max size = 20 current size = 10 top element = all
Queue elements: all of our dreams can come true if we just
Queue properties: empty = 1 max size = 20 current size = 0 top element = [None] |
Queue elements: The queue is empty!
Queue properties: empty = 0 max size = 20 current size = 6 top element = have
Queue elements: have the courage to pursue them
** Press any key to continue ** /** |
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest