#include<iostream>
using namespace std;
class stack
{
private:
int a[5]; //栈的大小
int n; //记录数组的下标
int t; //头指针?
public:
stack(); //构造函数
int push(int); //进栈
int show(); //出栈
bool empty(); //是否为空
bool full(); //是否为栈满
int display(); //输出
~stack();
};
stack::stack()
{
n=0; //初始化
t=-1;
}
bool stack::empty()
{
if(t==-1)
{
return true;
}
else
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载