CSI 202 HW #4 - Implement add_to_end for linked lists as discussed in class. Its parameters should be the list and a value and it should return a list. Remember to take special precautions for empty lists. Otherwise, you must first find the last node in the list and get new dynamic memory to link in a new node to make this work. My code for this is 12 lines long without shortcuts. - Implement a release all for a list which would release all the memory allocated in a list. Simply calling delete on the head will not release the entire list. Keep track of the "next" node while deleting the "current" one as you make your way down the list. Be sure to handle empty lists and not to derefence NULL. My code for this is 11 lines long without shortcuts. Your main could look like this: int main() { Node *head = NULL; char c = 'y'; int value; print(head); while(c == 'y') { cout << "Insert value: "; cin >> value; head = add_to_end(head,value); print(head); cout <<" Continue? (y/n): "; cin >> c; } head = release_all(head); print(head); } ------------- sample input ------------- 1 y 2 y 3 y 4 y 5 y 6 y 7 n ------------- sample output: ------------- Empty List 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 Even if you do not implement the following, you should read and think about them. ------------------ For extra practice ------------------ -Implement a "search for value" function. A function that takes a value and looks in a linked list for that value. It should return a pointer to the node containing the value or NULL if the node is not found. -Implement a "delete node" function that will remove a node pointed to. -With these two functions you then have the ability to "delete value" from a list which gives rise to a variety of other interesting possibilities. Such as "delete value and add to end" which would "demote" some value to the end of the list. You could even promote a value as well. -Implement a deep copy of the list. Test this by displaying the "addresses" of both lists and making sure they do not overlap and then displaying the actual lists using print.