CS 153 Data Structures I
Programming Assignment #7

Due: 10/4/01

This programming assignment is designed to:

NOTE ON THE USE OF PREVIOUS FILES - you MAY simply extend the capabilities of assignment #6. If you used the number 6 in the name, that's OK; just be sure to clearly label it as number 7 in your file header comments.

The following buttons should be added to the interface

  1. Insert Head
  2. Insert Tail
  3. Remove Head
  4. Remove Tail

Each of the above buttons of course needs a corresponding OnButtonFunction which in turn should call the appropriate new List member function.

The following member functions should be added to the List class to support the iterator capability

The following member variable should be added to the List class to support the iterator capability

The following member variable should be added to the List class to support InsertTail and RemoveTail

If your List class contains a Display() function it should be removed from the List class and moved to the ...Dlg class along with all of the OnButton... functions. Any OnButton... function that might cause a change in the List's content ought to call Display(). Display() should use the iterator capability something like the following

void Display()
{CString temp;
 myList.Reset();

 while( ! myList.EOF() )
 {    temp = myList.GetNext();
      // add temp to the ListBox
 }
}

Testing:

  1. Click Empty
  2. Click Full
  3. Click RemoveHead
  4. Click RemoveTail
  5. InsertHead
  6. Click Empty
  7. Click Full
  8. Click Find
  9. Click RemoveTail
  10. Click Find
  11. Click Empty
  12. Click Full
  13. InsertTail
  14. Click Empty
  15. Click Full
  16. Click Find
  17. Click RemoveHead
  18. Click Empty
  19. Click Full
  20. Click Find

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