Question
For this programming assignment, you will implement a Queue in C++ whose size can grow as elements are inserted into the queue. You will build
For this programming assignment, you will implement a Queue in C++ whose size can grow as elements are inserted into the queue. You will build three different implementations of this Queue. Two of these implementations will be array-based. Each of these two should take an initial capacity for the queue in the constructor. The only difference between these implementations will be what happens when the Queue is full. For the first implementation, ArrayQueue, you should increase the size of the array by a constant amount. For the second implementation, DoublingArrayQueue, you should double the size of the array. Finally, for the third implementation, you should implement a Queue using a Linked List.
Coding Portion (50 Points):
Start with the following template: Queue.h (eCampus), and create three versions of the Queue (using templates for the type of object) filling in all of the member functions.
For the Linked List, you will need to implement another class for the nodes in the Linked List.
Be sure to test the correctness of your algorithms and implementations.
Your code will be graded based on whether it compiles, runs, produces the expected output, produces correct output, whether or not your experimental setup is correct, and your coding style (does the code follow proper indentation/style and comments).
Here is the Queue.h file-
#ifndef ABSTRACT_QUEUE_H #define ABSTRACT_QUEUE_H
template class AbstractQueue { private: // data goes here
public: AbstractQueue(void) {}
~AbstractQueue(void) {}
bool empty(void) {}
int size(void) {}
Type front throw(exception) {}
Type dequeue() throw(exception) {} void enqueue ( Type e ) {} };
#endif
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started