没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include <iostream>
using namespace std;
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef struct{
int * base;
int * top;
int stacksize;
}SqStack;
int InitStack(SqStack & S)
{
S.base=(int*) malloc (STACK_INIT_SIZE * sizeof(int));
if(!S.base) exit(-1);
S.top=S.base;
S.stacksize=STACK_INIT_SIZE;
return 1;
}
int Push(SqStack &S,int e)
{
if(S.top-S.base>=S.stacksize)
{
S.base=(int*)realloc(S.base,(S.stacksize+STACKINCREMENT)*sizeof(int));
if(!S.base)exit(-1);
S.top=S.base+S.stacksize;
S.stacksize+=STACKINCREMENT;
}
*S.top++=e;
return 1;
}
int Pop(SqStack &S,int & e)
using namespace std;
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef struct{
int * base;
int * top;
int stacksize;
}SqStack;
int InitStack(SqStack & S)
{
S.base=(int*) malloc (STACK_INIT_SIZE * sizeof(int));
if(!S.base) exit(-1);
S.top=S.base;
S.stacksize=STACK_INIT_SIZE;
return 1;
}
int Push(SqStack &S,int e)
{
if(S.top-S.base>=S.stacksize)
{
S.base=(int*)realloc(S.base,(S.stacksize+STACKINCREMENT)*sizeof(int));
if(!S.base)exit(-1);
S.top=S.base+S.stacksize;
S.stacksize+=STACKINCREMENT;
}
*S.top++=e;
return 1;
}
int Pop(SqStack &S,int & e)







资源评论

- 桑榆ଲ2019-06-13很棒,值得学习
- qq_323905792015-11-19可以运行,相当不错,值得学习 代码简单
- plq1232013-02-03可以运行,相当不错,值得学习。
- Kin1352012-12-02资源很有用,值得参考。
JonNNN1
- 粉丝: 11
- 资源: 11

上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
已下载
下载帮助

看过该资源的人还看了
安全验证
文档复制为VIP权益,开通VIP直接复制
