//-------------------------------------------------------------------- // // Laboratory 4 show4.cpp // // Array implementation of the showStructure operation for the // List ADT // //-------------------------------------------------------------------- template < class LE > void List:: showStructure () const // Outputs the elements in a list. If the list is empty, outputs // "Empty list". This operation is intended for testing/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 << element[j] << "\t"; cout << endl; } }