In this program you will implement an iterable doubly-ended queue or deque (pronounced deck). You will write two classes, the first is an Iterator class we will use to iterate over the deque. The second is the deque.

class Iterator< T>
private Iterator() Create an empty Iterator.
Iterator & operator++() Returns the next element in the iteration.
Iterator & next() Returns the next element in the iteration.
T & operator*() Returns a reference to the current item.
bool operator==(const Iterator&) Compares this iterator for equality.
bool operator!=( const Iterator&) Compares this iterator for inequality.
bool hasNext() Returns true if the iteration has more elements.

The deque must be implemented as a doubly-linked list with the following functions; the use of a std:: C++ container will result in a zero for the entire assignment.

class Deque< T>
virtual Deque() Create an empty deque.
virtual bool isEmpty() const Determines if the deque contains no elements.
virtual Deque (const Deque&) Copy constructor.
virtual Deque& operator= (const Deque &) Assignment Operator
virtual ~Deque () Destructor
virtual void pushLeft(T item) Adds an item to the left side of the queue.
virtual void pushRight(T item) Adds an item to the right side of the queue.
virtual T& popLeft() Removes and returns an item from the left side of the queue.
virtual T& popRight() Removes and returns an item from the right side of the queue.
virtual Iterator & begin() const Returns an iterator to the front of the deque.
virtual end() const Returns an iterator to the end of the deque.
virtual T & operator[](int n) Returns a reference to the current item. Throws an exception if n is out of bounds.

Testing

1. Use the provided main to ensure your code will compile against the testing code.

2. Implement your own main method to test your code in a file called main.cpp. For testing purposes, implement any required functionality for parsing command-line arguments.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.