Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Node* pNew = new Node;
- Node* pPre =tempHead;
- Node* ploc;
- pNew->data=n;
- if(pPre->link == NULL)
- {
- pNew->link = pPre->link;
- pPre->link = pNew;
- }
- else if(pPre->link != NULL)
- {
- while(pPre->link != NULL)
- {
- pPre=pPre->link;
- }
- if(pPre->link == NULL)
- {
- pPre->link = pNew;
- pNew->link = NULL;
- }
- }
- return tempHead;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement