#include #include "Vstack.h" template class Array_stack : public Gstack { int sz; int top; T* astack; public: Array_stack(int Nitems ) { sz = Nitems; astack = new T[sz]; top = sz; } Array_stack( ) { sz = 100; astack = new T[sz]; top = sz; } ~Array_stack() { delete[] astack; } void push(T x) { assert( !isfull() ); astack[--top] = x; } T pop() { assert( !isempty() ); return( astack[top++] ); } bool isempty() { return( top == sz ); } bool isfull() { return( top == 0 ); } };