#include
#include
#include
#include
typedef struct ArcCell{
int adj;/*顶点关系类型,用1表示相邻,0表示不相邻*/
}ArcCell,**AdjMatrix;/*邻接矩阵*/
typedef struct type{
char data[3];/*顶点值*/
struct type *next;/*顶点的下一个指针*/
}VertexType;
typedef struct{
VertexType *vexs;/*顶点向量*/
AdjMatrix arcs;/*邻接矩阵*/
int vexnum,arcnum;/*图的顶点数和边数*/
}MGraph;
/* ****************** */
typedef int Status;
#define STACK_INIT_SIZE 50
typedef int ElemType;
typedef struct STACK /*定义栈类型*/
{
ElemType *base;
ElemType *top;
int stacksize;
int length;
}SqStack,*Stack;
void InitStack(Stack *S) /*初始化栈*/
{
*S=(SqStack *)malloc(sizeof(SqStack));
(*S)->base=(ElemType *)malloc(STACK_INIT_SIZE*sizeof(ElemType));
if(!(*S)->base)exit(-1);
(*S)->top=(*S)->base;
(*S)->stacksize=STACK_INIT_SIZE;
(*S)->length=0;
}
Status DestroyStack(Stack *S) /* 销毁栈*/
{
free((*S)->base);
free((*S));
return 1;
}
Status StackEmpty(SqStack S) /*判断栈空否*/
{
if(S.top==S.base) return 1;
else
return 0;
}
void Push(Stack *S,ElemType e) /*把数据压入栈*/
{
if((*S)->top - (*S)->base>=(*S)->stacksize)
{
(*S)->base=(ElemType *) realloc((*S)->base,
((*S)->stacksize + 10) * sizeof(ElemType));
if(!(*S)->base)exit(-1);
(*S)->top=(*S)->base+(*S)->stacksize;
(*S)->stacksize +=10;
}
*((*S)->top++)=e;
++(*S)->length;
}
Status Pop(Stack *S,ElemType *e)/*删除栈顶元素*/
{
if((*S)->top==(*S)->base) return 0;
*e=*((*S)->top-1);
--(*S)->length;
(*S)->top--;
return 1;
}
/* ******************** */
茶杯头甜蜜终章dlc 官方手机版v1.0.0.3
下载火柴人传说暗影格斗内置菜单 最新版v3.0.1
下载荒野乱斗测试服 安卓版v61.10.3
下载荒野乱斗彩虹服 安卓版v61.10.3
下载寒霜启示录 安卓版v1.25.10
寒霜启示录是一款生存模拟游戏,不少玩家可能对于末日都有着自己
末日城堡免广告版 安卓最新版v0.7.1
末日城堡免广告版是一款非常好玩的模拟经营类游戏,内部可以不看
甜蜜人生模拟器 最新版v1.4.5
甜蜜人生模拟器是一款非常好玩的模拟恋爱手游,玩家在这里能够对
武器锻造师内置功能菜单 v10.4
武器锻造师内置菜单版是游戏的破解版本,在该版本中为玩家提供了
开放空间overfield 安卓版v1.0.5
开放空间Overfield是一款箱庭养成经营手游,让你在广阔