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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!