Singly Linked List – In-Class Practice

$30.00 $24.00

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…

Rate this product

You’ll get a: zip file solution

 

Categorys:

Description

Rate this product

  1. Create a class named LinkedList in a file named LinkedList.h
  2. Create a ListNode structure as a private member of the class. The node should be able to hold a string called value.
  3. Create a head & tail pointer as private attributes of the class.
  4. Create the following public member functions:
    1. A constructor, which will set both head & tail to NULL
    2. A destructor, which will traverse the linked list and delete each node
    3. 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
    4. A function called displayList, which will traverse the linked list and print out the value in each node.
  5. Create a source file named Driver.cpp
    1. Create a main function that will create an instance of LinkedList called dogBreeds.
    2. Call the appendNode function 5 times sending the following dog breeds to the function:
      1. Corgi
      2. English Bulldog
      3. Dalmatian
      4. German Shepard
      5. Poodle
    3. Call the displayList function.
    4. Print out “Goodbye!”
Singly Linked List – In-Class Practice
$30.00 $24.00