Complete the remove() function
Delete a node that stores the "data" passed in the list. Return true if the node was found, false if not.
The traversal and if condition are already done for you.
- Edit List.cpp. You will edit List::remove(int data).
-
Implement the pointer logic in the section of code labeled "PUT CODE HERE". For example, if the linked list is:
m_head -> 1 -> 4 -> 5 -> 7 -> 8 -> NULL
Lets say you wanted to delete 4. current would stop at the node that has 1. It is your task to delete the Node that has 4 in it and have the 1 Node's next point to the 5 node. Make sure you make the connection between the two surrounding nodes before you delete the middle one!