Implement a template class Queue as defined by the following skeleton: template class Queue { private: NodeType* front; // It points to the front of a singly-linked list NodeType* rear; // It points to the end of a singly-linked list public: Queue( ); // default constructor: Queue is created and empty Queue(const Queue &x); // copy constructor: implicitly called // for a deep copy void MakeEmpty(); // Queue is made empty; you should deallocate all // the nodes of the linked list bool IsEmpty( ); // test if the queue is empty bool IsFull( ); // test if the queue is full; assume MAXITEM=5 int length( ); // return the number of elements in the queue void Print( ); // print the value of all elements in the queue in the sequence // from the front to rear void Enqueue(ItemType x); // insert x to the rear of the queue // Precondition: the queue is not full void Dequeue(ItemType &x); // delete the element from the front of the queue // Precondition: the queue is not empty
~Queue(); // Destructor: memory for the dynamic array needs to be deallocated }; In you main( ) routine, you need to test your class in the following cases: QueueIntQueue; int x; IntQueue.MakeEmpty(); IntQueue.Dequeue(x); IntQueue.Enqueue(10); IntQueue.Enqueue(20); IntQueue.Enqueue(30); IntQueue.Enqueue(40); cout FloatQueue; string y; FloatQueue.MakeEmpty(); FloatQueue.Dequeue(y); FloatQueue.Enqueue(bob); cout FloatQueue2 = FloatQueue; cout Question 2 Implement a template class Queue as defined by the following skeleton: class Queue NodeType ItemTypefront: It points to the front of a singly-linked list NodeType ItemTyperear,It points to the end of a singly-linked list public: Queue; default constructor: Queue is created and empty Queue(const Queue ItemType &x); lcopy constructor: implicitly called void MakeEmpty: Queue is made empty; you should deallocate all bool IsEmpty): test if the queue is empty for a deep copy W the nodes of the linked list bool IsFull: test if the queue is full: assume MAXITEM-S int length: retun the number of elements in the queue void Print: print the value of all elements in the queue in the sequence / from the front to rear void Enqueue(ItemType x): insert x to the rear of the queue void Dequeue(ItemType &x); delete the element from the front of the queue -Queue; Destructor: memory for the dynamic array needs to be deallocated Precondition: the queue is not full In you main) routine, you need to test your class in the following cases: int x (10) (20) 40) cout