Implement a template class queue from scratch; that is, don't use the C++ list other such data structure classes.
Implement queue as linked nodes, using an inner Node struct that is singly linked with a data member and next member that points to the next Node.
Node should have a constructor to initialze its members.
The queue class should have private members
- int size;
- Node *front;
- Node *rear;
and public members
- queue() /* constructor */
- void insert(const E& x)
- E peekfront() const;
- E remove();
- bool empty() const;
- int size() const;
- ~queue() /* destructor */
The destructor should delete all remaining nodes, if any.