1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
437 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef STACK_H
#define STACK_H
//const int maxSize = 50;
template<class T>
class Stack
{
public:
Stack(){} //构造函数
virtual void Push(const T& x) = 0; //新元素x进栈
virtual bool Pop(T& x) = 0 ; //栈顶元素出栈由x返回
virtual bool getTop(T& x) = 0; //读取栈顶元素由x返回
virtual bool IsEmpty()const = 0; //判断栈空否
virtual bool IsFull()const = 0; //判断栈满否
virtual int getSize() = 0; //计算栈中元素个数
};
#endif