没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include<iostream>
#include<cstdlib>
#include<conio.h>
using namespace std;
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
typedef int Status;
typedef double SElemType;
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef struct
{
SElemType *base;
SElemType *top;
int stacksize;
}SqStack;
//---------------------------------------------------------------------------------
bool IsError; //全局变量用于标记错误
int nn;
//********************栈的相关操作*************************
//初始化栈
Status InitStack(SqStack &S)
{
S.base=S.top=(SElemType *)malloc(STACK_INIT_SIZE*sizeof(SElemType));
if(!S.base)
exit(OVERFLOW);
S.stacksize=STACK_INIT_SIZE;
return OK;
}
//销毁栈
Status DestroyStack(SqStack &S)
{
if(!S.base)
return ERROR;
delete []S.base;
return OK;
}
//判断栈是否空
bool StackEmpty(SqStack S)
{
int nn;
//********************栈的相关操作*************************
//初始化栈
Status InitStack(SqStack &S)
{
S.base=S.top=(SElemType *)malloc(STACK_INIT_SIZE*sizeof(SElemType));
if(!S.base)
exit(OVERFLOW);
S.stacksize=STACK_INIT_SIZE;
return OK;
}
//销毁栈
Status DestroyStack(SqStack &S)
{
if(!S.base)
return ERROR;
delete []S.base;
return OK;
}
//判断栈是否空
bool StackEmpty(SqStack S)
{
剩余17页未读,继续阅读
资源评论
chuxuezhe1230
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功