Extend the function eraseValue() to erase all occurrences of "target" in the linked list.
template < typename T >
void eraseAll (node * & front, const T& target);
This is the implementation of eraseValue() that must be modified.
node< T > *curr = front, *prev = NULL;
bool foundItem = false;
while (curr != NULL && !foundItem )
if (curr->nodeValue == target)
if (prev == NULL)
front = front -> next;
prev->next = curr-> next;
foundItem = true;
prev = curr;
curr = curr-> next;
To erase all occurences of "target" in the linked list, you need to make following modifications to the given code.
1. Change "while (curr != NULL && !foundItem )" to "while (curr != NULL)" so that entire linked list is scanned for target value, rather than just stopping after finding first ...
The solution first mentions what needs to be modified in eraseValue function to extend it to eraseAll function, and then gives the code for eraseAll function.
Classroom management with students with special needs
I have to write 500 words on classroom management and the importance of it especially when dealing with special needs kids. I have attached some of the information I have found thus far. But it all needs to tie in and talk about the components of classroom management. Please help get me started.View Full Posting Details