summaryrefslogtreecommitdiff
path: root/c/dataStructure/栈和队列//链栈/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/dataStructure/栈和队列/栈/链栈/stack.h')
-rwxr-xr-xc/dataStructure/栈和队列/栈/链栈/stack.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/c/dataStructure/栈和队列/栈/链栈/stack.h b/c/dataStructure/栈和队列/栈/链栈/stack.h
new file mode 100755
index 0000000..33e9ffe
--- /dev/null
+++ b/c/dataStructure/栈和队列/栈/链栈/stack.h
@@ -0,0 +1,25 @@
+#ifndef _STACK_H
+#define _STACK_H
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<stdbool.h>
+#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