Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. Node* pNew = new Node;
  2. Node* pPre =tempHead;
  3. Node* ploc;
  4. pNew->data=n;
  5. if(pPre->link == NULL)
  6. {
  7. pNew->link = pPre->link;
  8. pPre->link = pNew;
  9. }
  10.  
  11. else if(pPre->link != NULL)
  12. {
  13. while(pPre->link != NULL)
  14. {
  15. pPre=pPre->link;
  16. }
  17. if(pPre->link == NULL)
  18. {
  19. pPre->link = pNew;
  20. pNew->link = NULL;
  21. }
  22. }
  23.  
  24. return tempHead;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement