//--------------------------------------------------------------------
//
//  Laboratory 4                                          show4.cpp
//
//  Array implementation of the showStructure operation for the
//  OrdList ADT.
//
//--------------------------------------------------------------------

void OrdList:: showStructure () const

// Outputs the keys of the data items in a list. If the list is
// empty, outputs "Empty list". This operation is intended for
// testing and debugging purposes only.

{
    int j;   // Loop counter

    if ( size == 0 )
       cout << "Empty list" << endl;
    else
    {
       cout << "size = " << size
            <<  "   cursor = " << cursor << endl;
       for ( j = 0 ; j < maxSize ; j++ )
           cout << j << "\t";
       cout << endl;
       for ( j = 0 ; j < size ; j++ )
           cout << dataItems[j].getKey() << "\t";
       cout << endl;
    }
}


