CS 153 Data Structures I
Program #7 - Expand Doubly Linked List

Due Date: October 5, 2000, during your teams scheduled time.  If you would Like to demo your program before Thursday, you can do so by scheduling an appointment with a TA.

Emphasis:

Discussion:  The LIST object that you created for #6 was 'stateless' meaning that each time you called Insert or Remove or Find the object did not remember anything about what had transpired.  This assignment will add a state variable to the object which will be called pCurrent here.  pCurrent will be of type Node * (the address of a Node or NULL).  pCurrent specifies where in the list of Nodes you currently are looking. Most of the member functions use or modify pCurrent.  Be very careful with pCurrent.  If it is allowed to contain #$%^&*@ your otherwise correct functions will 'blow up'.

Program Requirements:  This linked list will be a modified version of your previous List.

REMOVE the friend declaration from the Class List.  ...Dlg must not be a friend in this assignment.  The DisplayList function that needed the friend(ship) will use the Iterator functions instead.  How to do this is explained at the bottom.

Place enough buttons on your GUI to test all of the functionality.

The following are the required functions (in addition to the member functions already required in #6):

Example of how DisplayList() might be programmed using the List Iterator member functions making unnecessary the undesirable 'friend' capability.

void DisplayList()
{                            // The CListBox is named m_DisplayBox
    CString data;
    m_DisplayBox.ResetContent();
    L.Reset();
    while( L.EOL() != true )
    {
        data = L.GetNext();
        m_DisplayBox.AddString(data);
    }
}

Make sure that every time you call a function you meet the preconditions for that function!
Make sure you have preconditions, post conditions and a one-line description of your program with every function prototype. (in the header file!)
Make sure you comment variables which are not self explanatory.
Make sure you comment logical blocks of code.
Don't comment every line of your code.