private:
struct node {
std::string elem;
node *next;
}
node *head, *tail;
}
string Queue::dequeue() {
if(head==NULL)
error('Dequeing an empty queue")
string str=head->elem;
node *next = head->next;
delete head;
head=next;
if(head==NULL) tail=NULL;
return str;
}