CSI 202 HW #4 - Implement add_to_end for linked lists as discussed in class. As a function, the parameters would be the list and a value and it should return a list. You need to do this in two pieces. - First, write code to find the end of the list (the tail) while beginning at the head. - Then write code to attach a new node to the end of the list. = Remember you may have 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 roughly 12 lines long without shortcuts. If you wrote add_to_end as a function, your main could look like this: int main() { Node *head = NULL; string c = "yes"; int value; print(head); while(c == "yes") { cout << "Insert value: "; cin >> value; head = add_to_end(head,value); print(head); cout <<" Continue? (y/n): "; cin >> c; } 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. -Write a function to release all the memory allocated in your list. You'll need to be careful not to release a pointer to an object before you get to the object. You could also use your find tail code to always release from the end.