Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Pop (Stack *S) {
- StackNode *p, *q;
- if (S->size == 1) {
- q = S->first;
- S->first = NULL;
- }
- else {
- q=S->first;
- while(q->next != NULL)
- q = q->next;
- }
- printf("popping = %d\n", q->item);
- destroyItem(&q->item);
- q = NULL;
- free(q);
- S->size--;
- }
Add Comment
Please, Sign In to add comment