Description
- Create a class named LinkedList in a file named LinkedList.h
- Create a ListNode structure as a private member of the class. The node should be able to hold a string called value.
- Create a head & tail pointer as private attributes of the class.
- Create the following public member functions:
- A constructor, which will set both head & tail to NULL
- A destructor, which will traverse the linked list and delete each node
- A function called appendNode, which will accept a string as a parameter, create a new node with this string as its value, and append the node to the end of the list
- A function called displayList, which will traverse the linked list and print out the value in each node.
- Create a source file named Driver.cpp
- Create a main function that will create an instance of LinkedList called dogBreeds.
- Call the appendNode function 5 times sending the following dog breeds to the function:
- Corgi
- English Bulldog
- Dalmatian
- German Shepard
- Poodle
- Call the displayList function.
- Print out “Goodbye!”