#include <stdio.h>
#define MaxSize 10
//定义共享栈 提高了栈的利用率
typedef struct{
ElemType data[MaxSize];
int top0;
int top1;
}ShStack;
//初始化栈
void InitStack(ShStack &s){
s.top0=-1;
s.top1=MaxSize;
}
//判断栈满
bool stackEmpty(ShStack s){
if(s.top0+1==s.top1)
return ture;
else
return false;
}
int main(void) {
ShStack s;
return 0;
}
共享栈是顺序栈的一种,两个栈使用同一片存储空间