Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void InsertNewLast(DataItem value, Node **L) {
  2. if ((*L) == NULL) {
  3. (*L) = new Node();
  4. (*L)->next = NULL;
  5. (*L)->data = value;
  6. cout << value << endl;
  7. }
  8. else {
  9. while ((*L)->next != NULL) {
  10. (*L) = (*L)->next;
  11. }
  12. (*L)->next = new Node();
  13. (*L)->next->data = value;
  14. (*L)->next->next = NULL;
  15. cout << value << endl;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement