CS 153 Data Structures I
Programming Assignment #6

Due: 9/27/01

This programming assignment is designed to introduce the use of Link Lists to:

NOTE ON THE USE OF PREVIOUS FILES - Don't

You will probably want to use much of the code that you developed for assignment #4. To do that, follow these suggestions

  1. Create your new project 6
  2. Copy/paste the .h and .cpp files from assignment 4 into your new project 6 directory
  3. From the 'file' view, right click on the ProjectFiles entry and select 'Add file to project'
  4. Modify the copied files to meet the new specifications

In order to meet these goals you will keep the user interface from Assignment #4

Since 'Nodes' make up the elements of the list you will need to define either a Class or Struct of type Node. It should contain the following members:

Your Class CList should contain the same public member functions as Assignment #4. The m_data member should be renamed to m_Head of type Node *; i.e. m_Head will be the address of the 1st Node in the list. Be sure to remember to have the CList() constructor initialize m_Head to NULL.

The behavior of your program should be as follows:

Testing:

  1. Click Empty
  2. Click Full
  3. Click Remove
  4. Insert a CString
  5. Click Empty
  6. Click Full
  7. Click Find
  8. Click Remove
  9. Click Find
  10. Click Empty
  11. Click Full

Follow the above steps BEFORE you even try inserting 2 or more items into the list. When the list goes from 'empty' to have 1 Node in the list is one of the hardest places to get correct.