SHARE
TWEET

Untitled

a guest Apr 25th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top