微调与更新栈

This commit is contained in:
2023-10-18 18:00:04 +08:00
parent bd56fdcd73
commit 37f331b842
8 changed files with 134 additions and 6 deletions

31
数据结构/栈/Stack.h Normal file
View File

@@ -0,0 +1,31 @@
/*
*@文件: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