i need this problem 2 be solved quickly plz help me i hve a simple code that i wrote i hope it code helps u

a double-ended queue or deque(pronounced"deck")is a generalization of botha stackand a queue.
itsupports the insertion and removal of items from either the front of the back of the queue.
using a dynamiclist,implement a deque class that supportsthe following:
deque //construct an empty deque.
bool is Empty //return true if the queue is empty,false otherwise.
void addfirst(Item item) //insert an item @ the front of the qeueu.
void addlast(Item item) //insert the item @ the end of the qeueu.
Item removerfirst() //delete and return the first item in the queue.
Item removelast() //delete and return the last item in the queue
And plz write the main() for me

# include <iostream.h>

class deque
{
private:
struct node
{
int data ;
node * next;
};
node* head;
node* tail;
public:
deque();
bool empty ();
void enque(int e);
void addfirst(int item);
void addlast(int item);
int removefirst(int e);
int removelast(int e);
};

deque::deque()
{
head=0;
tail=0;

}

bool deque ::empty()
{
return(head==0);
}

void deque::enque(int e)
{
node*p=new node;
p->data=e;
p->next=0;
if(head==0)
{
head=p;
}
else
{
tail->next=p;
}
tail=p;
}

void deque::addfirst(int item)
{
node*p=new node;
p->data=item;
p->next=head;
}
void deque::addlast(int item)
{
node*p=new node;
p->data=item;
tail->next=p;
tail=p;
}

int deque::removefirst(int e)
{
node*z=new node;
e=z->data;
head=head->next;
delete z;
return e;
}

int removelast(int e)
{
node* z=new node;
node* w=new node;
while(z->next!=tail)
{
z=z->next;
w=tail;
e=w->data;
tail=z;

}
delete w;
return e;
}







a double-ended queue or deque(pronounced"deck")is a generalization of botha stackand a queue.
itsupports the insertion and removal of items from either the front of the back of the queue.
using a dynamiclist,implement a deque class that supportsthe following:
deque //construct an empty deque.
bool is Empty //return true if the queue is empty,false otherwise.
void addfirst(Item item) //insert an item @ the front of the qeueu.
void addlast(Item item) //insert the item @ the end of the qeueu.
Item removerfirst() //delete and return the first item in the queue.
Item removelast() //delete and return the last item in the queue