Homework #2 - Linked Lists and Dynamic Data Structures Homework handin and requirements: 1) You'll be making a script as your handin. 2) Your script should cat your file. 3) Your script should show compilation. 4) Your script should demonstrate your program operating on a variety of input. 5) Your script should demonstrate your program operating on a variety of input AGAIN. Multiple runs are required. 6) Handin will consist of your script file and source code on canvas. 7) You must place a comment as the first line of your code that has your name. 8) You must place a comment as the next line(s) of your code that has your honor code pledge 9) You must place a comment as the next line(s) of your code that lists resources that you have used to solve this project. This may include people, tutors, websites, relatives, etc. You must also list a brief description of the kind of the kind of help they provided. Failure to incorporate these components may result in a 0% for this assignment. In this homework you will be creating a Linked List class that will allow us to insert and delete single elements at a time to a list. Thsi si an incredibly useful data structure that has many advantages over large arrays and adding single elements to them. Our class will take advantage of the Node we built before. LLNode is a simple data structure that looks like this: class LLNode { public: LLNode *next; int value; }; The linked List class begins life like this: class LinkedList { private: LLNode * head; LinkedList( const LinkedList & ){ } //empty copy constructor - is private LinkedList& operator=(const LinkedList&) { } //copy assignment - private public: LinkedList(); ~LinkedList(); void insert(int value); void remove(int value); void print(); //you can also overload << }; Notice how it uses an LLNode pointer as we discussed in class. Your job will be to extend the LinkedList class to add functionality to it. In particular, you will be adding a constructor, a print function, destructor, an insert function and a remove function. - The constructor should initialize the list to be empty/NULL. - The destructor should deallocate all allocated data from the list. - The print function should output the integer values in the list. - The insert function should insert a value to the front of the list. - The remove function should remove and deallocate (if found) the first node with the value in the list. There are other things we won't consider in this assignment that become crucial for dynamic data and the shallow copy vs. deep copy problem. These two are the copy constructor and copy assignment. To prevent the attempted copy of a list, we put the copy assignment and copy constructor prototypes in private. A sample main may look like this: int main() { LinkedList mylist; char more = 'y'; while(more == 'y') { mylist.print(); cout << "Insert another value? (y/n): "; cin >> more; if(more == 'y') { cout << "Input an integer to insert: "; int n; cin >> n; mylist.insert(n); } } mylist.print(); more = 'y'; while(more == 'y') { mylist.print(); cout << "Remove another value? (y/n): "; cin >> more; if(more == 'y') { cout << "Input an integer to remove: "; int n; cin >> n; mylist.remove(n); } } }