Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- T dequeue() //removeBack
- {
- if (head == NULL) //empty
- {
- return NULL;
- }
- else if (head->next == NULL) //only one item
- {
- T output;
- output = head->data;
- head = NULL;
- delete head;
- return output;
- }
- else
- { T output;
- temp = tail;
- output = tail->data;
- tail = temp->prev;
- tail->next = NULL;
- delete temp; //ERROR OCCURS HERE
- //tail->next = NULL;
- return output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement