#include<stdio.h>
#include<stdlib.h>
typedef int ElemType;
typedef struct snode
{
ElemType data;
struct snode *next;
}LinkSTACK;
/*初始化*/
void StackInitiate(LinkSTACK *head)
{
head->next = NULL;
}
/*判断栈是不是空栈*/
int StackNotEmpty(LinkSTACK *head)
{
if (head->next == NULL)
return 0;
else
return 1;
}
/*入栈*/
int StackPush(LinkSTACK *spu, ElemType x)
{
LinkSTACK *p;
if ((p = (LinkSTACK *
数据结构(6):栈的链式存储结构及其基本运算的实现
最新推荐文章于 2022-07-26 22:11:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)