Guest User

Untitled

a guest
Feb 28th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. T removeFront() //removeFront
  2.     {
  3.         if (head == NULL)
  4.         {
  5.             return NULL;
  6.         }
  7.         else if (head->next == NULL)
  8.         {
  9.             T output;
  10.             output = head->data;
  11.             delete head;
  12.             return output;
  13.         }
  14.         else
  15.         {  
  16.             T output;
  17.             temp = head;
  18.             output = head->data;
  19.             head = head->next;
  20.             delete temp;
  21.             head -> prev = NULL;
  22.             return output;
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment