其他分享
首页 > 其他分享> > 【保存2】

【保存2】

作者:互联网

include <stdio.h>

include <stdlib.h>

typedef int Selemtype;

define TURE 1

define FALSE 0

define STACK_INIT_SIZE 100

define STACKINCREMENT 10

/---栈的顺序存储结构(动态)---/

typedef struct
{
Selemtype *base;
Selemtype *top;
int Stacksize;

}SeqStack;

/---栈的初始化---/

int InitStack(SeqStack *s)
{
s->base = (SeqStack *)malloc(sizeof(SeqStack))
if(!s->base) printf("完犊草子");
else
{
s->top = s->base;
s->Stacksize = STACK_INIT_SIZE;
}
return TURE;
}

/---判断栈是否为空---/

int IsEmpty(SeqStack *s)
{
if(s->top == s->base)
return TURE;
else
return FALSE;
}

int Push()

标签:SeqStack,int,Selemtype,保存,---,base,define
来源: https://www.cnblogs.com/zhujiaozhu/p/15401369.html