Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LinkedList
- {
- public:
- Node *head;
- Node *tail;
- LinkedList(int array[], int size)
- {
- //do something
- while(i < size)
- {
- //manipulate pointer
- Node *node = new Node(array[i]);
- }
- }
- ~LinkedList()
- {
- Node *currNode = head;
- Node *nextNode = head;
- while(currNode)
- {
- nextNode = currNode->next;
- delete currNode;
- currNode = nextNode;
- }
- }
- };
Add Comment
Please, Sign In to add comment