//-------------------------------------------------------------------- // // Laboratory 5, In-lab Exercise 2 stackdwn.h // // Class declaration for the array implementation of the Stack ADT // that grows from the end of the array downward toward the // beginning // //-------------------------------------------------------------------- const int defMaxStackSize = 10; // Default maximum stack size template < class SE > class Stack { public: // Constructor Stack ( int maxNumber = defMaxStackSize ); // Destructor ~Stack (); // Stack manipulation operations void push ( const SE &newElement ); // Push element SE pop (); // Pop element void clear (); // Clear stack // Stack status operations int empty () const; // Stack is empty int full () const; // Stack is full // Output the stack structure -- used in testing/debugging void showStructure () const; private: // Data members int maxSize, // Maximum number of elements in the stack top; // Index of the top element SE *element; // Array containing the stack elements };