1. Write a program which implements an unbounded double-ended queue container (using the double-linked list) as a template structure (aimed at storing values of any type), and a set of methods operating on this structure:
• the default constructor,
• the destructor (with memory deallocation),
• the copy-constructor (with memory allocation),
• the assignment operator= (with memory dellocation and allocation),
• the comparison operator==,
• push_front – adding a value to the queue as the first (with memory allocation),
• pop_front – removig the first value from the queue or throwing an empty queue exception (with memory deallocation),
• push_back – adding a value to the queue as the last (with memory allocation),
• pop_back – removig the last value from the queue or throwing an empty queue exception (with memory deallocation),
• front – returning the first value or throwing an empty queue exception,
• back – returning the last value or throwing an empty queue exception,
• empty – informing whether the queue is empty,
• size – returning the number of items in the queue,
• clear – removing all the items from the queue (with memory deallocation).
The program should use all these methods to make the operations as follows:
1) create a queue of integers containing the numbers given by the user (placing them at the beginning or at the end of the queue, according to the user's decision),
2) print the first and the last number,
3) remove the first or the last value from the queue, 4) print the first and the last number,
5) print the number of values in the queue if it is nonempty, or an appropriate message otherwise,
6) clear the queue.
Compare your implementation of the container with the built-in containers delivered in
<deque> and <list> libraries.
2. Implement an unbounded queue (using non-sequential memory storage – the linked list) as a template structure (aimed at storing values of any type), and a set of methods operating on this structure mentioned in the task of lab 6. Compare your implementation with the built-in structure delivered in <queue> library.
3. Implement a structure of a process with an identifier (PID), a name, an execution message, the default constructor and proper setters and gettters for the attributes. Write a program which implements a queue of processes with attributes given by the user. Allow the user to:
- add a new process to the queue (at the end by default),
- execute the first process from the queue (printing its execution message and removing it from the queue),
- move the lastly added process to the beginning of the queue, - check the current number of processes in the queue,
- clear the queue.
Use the double-ended queue structure implemented in task 1.