1 Star 0 Fork 5

卢国祥/C Data Structure

forked from Shapper/C Data Structure 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sh_stack.h 772 Bytes
一键复制 编辑 原始数据 按行查看 历史
Shapper 提交于 2022-10-31 17:55 +08:00 . 添加栈相关内容
//
// Shared Stack
// Created by Win10 on 2022/10/31.
//
#ifndef C_DATA_STRUCTURE_SH_STACK_H
#define C_DATA_STRUCTURE_SH_STACK_H
#define MaxSize 10
typedef int ElemType;
typedef struct {
ElemType data[MaxSize];
int top0;
int top1;
} ShStack;
void InitStack(ShStack &S);
bool StackEmpty(ShStack S);
bool StackFull(ShStack S); //判断栈是否满了
bool Push0(ShStack &S, ElemType x);
bool Push1(ShStack &S, ElemType x);
bool Pop0(ShStack &S, ElemType &x);
bool Pop1(ShStack &S, ElemType &x);
bool GetTop0(ShStack S, ElemType &x);
bool GetTop1(ShStack S, ElemType &x);
bool DestoryStack0(ShStack &S);
bool DestoryStack1(ShStack &S);
void InitStack(ShStack &S) {
S.top0 = -1;
S.top1 = MaxSize;
}
#endif //C_DATA_STRUCTURE_SH_STACK_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/noob-coder/c-data-structure.git
git@gitee.com:noob-coder/c-data-structure.git
noob-coder
c-data-structure
C Data Structure
master

搜索帮助