From c6bc541ab58363d783e60a007e80e9bf9e231fda Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 5 Dec 2022 19:43:39 +0800 Subject: initialize --- .../\346\240\210/\351\223\276\346\240\210/stack.h" | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 "c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\346\240\210/\351\223\276\346\240\210/stack.h" (limited to 'c/dataStructure/栈和队列/栈/链栈/stack.h') diff --git "a/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\346\240\210/\351\223\276\346\240\210/stack.h" "b/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\346\240\210/\351\223\276\346\240\210/stack.h" new file mode 100755 index 0000000..33e9ffe --- /dev/null +++ "b/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\346\240\210/\351\223\276\346\240\210/stack.h" @@ -0,0 +1,25 @@ +#ifndef _STACK_H +#define _STACK_H + +#include +#include +#include +#include"tree.h" + +typedef Node * ElemType; + +typedef struct stack{ + ElemType data; + struct stack * next; +} stack; + +typedef stack * Stack; + +bool InitStack(Stack * s); +bool DestroyStack(Stack * s); +bool Push(Stack * s, ElemType n); +bool Pop(Stack * s, ElemType * n); +ElemType GetTop(Stack * s); +bool StackIsEmpty (Stack * s); + +#endif -- cgit v1.2.3-70-g09d2