nguyentruong98

Untitled

Dec 3rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. void pop(Stack *s)
  2. {
  3.       Node* iterator;
  4.       if(s->head == NULL)
  5.       {
  6.             printf("ERROR STACK");
  7.             return;
  8.       }
  9.       iterator = s->head;
  10.       while (iterator->next != s->tail)
  11.       {
  12.             iterator = iterator->next;
  13.       }
  14.       iterator->next = NULL;
  15.       s->tail = iterator;
  16.       return;
  17. }
Add Comment
Please, Sign In to add comment