Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AddLast_Stack(node &head, int data)
- {
- if (Is_Empty(head))
- head = getNODE(data);
- else
- {
- node h = NULL, p = head;
- while (head)
- {
- Push(h, head->value);
- Pop(head);
- }
- Push(head, data);
- while (p)
- {
- Push(head, p->value);
- p = p->next;
- }
- DestroyList(h);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement