Guest User

Untitled

a guest
Mar 6th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class LinkedList
  2. {
  3. public:
  4. Node *head;
  5. Node *tail;
  6. LinkedList(int array[], int size)
  7. {
  8. //do something
  9. while(i < size)
  10. {
  11. //manipulate pointer
  12. Node *node = new Node(array[i]);
  13. }
  14.  
  15. }
  16.  
  17. ~LinkedList()
  18. {
  19. Node *currNode = head;
  20. Node *nextNode = head;
  21. while(currNode)
  22. {
  23. nextNode = currNode->next;
  24. delete currNode;
  25. currNode = nextNode;
  26. }
  27. }
  28. };
Add Comment
Please, Sign In to add comment