CSC1310: LAB 5 String Linked List

$30.00 $24.00

What Should This Program Do? Linked List Class Design your own linked list class (List.h) to hold a series of strings. The linked list node should be implemented as a struct. The class should have member functions for appending, inserting, and deleting nodes. You should also have a display function that will traverse the list…

Rate this product

You’ll get a: zip file solution

 

Categorys:

Description

Rate this product

What Should This Program Do?

Linked List Class

  • Design your own linked list class (List.h) to hold a series of strings.
  • The linked list node should be implemented as a struct.
  • The class should have member functions for appending, inserting, and deleting nodes.
  • You should also have a display function that will traverse the list & display each node’s value.
  • Don’t forget to add a destructor that destroys the list.

DRIVER – Lab5.cpp

Write a driver program (Lab5.cpp) that will do the following:

  1. Create a linked list object
  2. Call the linked list’s append function to append the following strings to your linked list. Afterwards, print to the screen to tell the user that you are inserting several strings to the list.
    1. “boogeyman”
    2. “ghost”
    3. “scarecrow”
    4. “witch”
    5. “zombie”
  3. Now call the linked list’s display function to print the list.
  4. Now call the linked list’s insert function to insert the “vampire” string in the correct sorted position. Print to the screen to tell the user that you are inserting “vampire” in to the list.
  5. Now call the linked list’s display function again to print the list.
  6. Now call the delete function to delete “ghost” from the list. Print to the screen to tell the user that you are deleting “ghost” from the list.
  7. Last, call the linked list’s display function again to print the list.

Sample Output

The linked list has been created.

I am appending several strings to the list.

boogeyman

ghost

scarecrow

witch

zombie

I am inserting vampire in the list.

boogeyman

ghost

scarecrow

vampire

witch

zombie

I am deleting ghost from the list.

boogeyman

scarecrow

vampire

witch

zombie

All list nodes have been removed.

What to Turn In

  • List.h
  • Lab6.cpp
CSC1310: LAB 5 String Linked List
$30.00 $24.00