Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. void AddLast_Stack(node &head, int data)
  2. {
  3. if (Is_Empty(head))
  4. head = getNODE(data);
  5. else
  6. {
  7. node h = NULL, p = head;
  8. while (head)
  9. {
  10. Push(h, head->value);
  11. Pop(head);
  12. }
  13. Push(head, data);
  14. while (p)
  15. {
  16. Push(head, p->value);
  17. p = p->next;
  18. }
  19. DestroyList(h);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement