Lab6: Linked Lists

In this lab we will work on setting up a class to manage a list of objects. In this exercise the list will be a simple one. Later, we will change it to make it useful in our simulation project.

Using the TDD Linked List lecture as a base (the code for which is on GitHub_ at TDD Linked List Development, you are to add a few features to this project:

  • Insert at the end of the list
  • Insert into the list in numerical order.

That last one is the toughest, since you will be breaking an existing list and hooking a node into the middle of it. Be sure to document all of the possible cases you might run into when doing this, and add code to handle each one.

To prove that your code works, take the main.cpp file and set it up to add a sequence of items into your list, then print the items put using the print routine provided.