// -- Node struct (for elements of the linked list) struct Node { string value; Node * next; }; // -- Main Queue class class Queue { private: Node * front; Node * back; public: // -- Add an element to the back void add(string s); // -- Remove an element from the front string remove(); // -- Return true if the queue is empty bool empty() { return ((front == NULL) && (back == NULL)); } }; void Queue::add(string s) { Node * n = new Node(); n->value = s; if (empty()) { front = n; back = n; } else { back->next = n; back = n; } } string Queue::remove() { if ( ! empty()) { Node * temp = front; string result = temp->value; delete temp; front = front->next; return result; } return ""; }