31 lines
704 B
C
31 lines
704 B
C
/*
|
|
*@文件:Stack.h
|
|
*@作者:‘你遇了我’
|
|
*@time:2023/10/18
|
|
*@联系:QQ:321640253
|
|
*@版本:V1.0
|
|
*@描述:顺序泛型栈
|
|
*/
|
|
#ifndef _STACK_H_
|
|
#define _STACK_H_
|
|
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
void *container;
|
|
uint16_t size;
|
|
uint16_t MaxSize;
|
|
uint16_t NodeSize;
|
|
int Top;
|
|
} SqStack;
|
|
|
|
|
|
|
|
/**********************函数声明区************************/
|
|
void InitStack(SqStack *S,uint16_t MaxSize,uint16_t NodeSize); //初始化栈
|
|
void *PushStack(SqStack *S); //进栈
|
|
void *PopStack(SqStack *S); //出栈
|
|
void DestroyStack(SqStack *S); //销毁栈
|
|
|
|
#endif |