#ifndef List_H_INCLUDED
#dene List_H_INCLUDED
template <class elemtype>
class List
{
public:
virtual void push(elemtype x)=0;
virtual elemtype top()=0;
virtual void pop()=0;
virtual bool Isfull()=0;
virtual bool Isempty()=0;
virtual ~List(){}
};
#endif // List_H_INCLUDED
#ifndef stack_H_INCLUDED
#dene stack_H_INCLUDED
#include<iostream>
#include"List.h"
using namespace std;
template <class elemtype>
class stack:public List<elemtype>
{
public:
void push(elemtype x);
void pop();
elemtype top();
void doubleSize();
bool Isfull();
bool Isempty();
stack(){
stackTop=0;
MaxSize=10;
list =new elemtype[MaxSize];
}
private:
int MaxSize;
int stackTop;
elemtype *list;
};