summaryrefslogtreecommitdiff
path: root/c/dataStructure/栈和队列//顺序栈/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/dataStructure/栈和队列/栈/顺序栈/stack.h')
-rwxr-xr-xc/dataStructure/栈和队列/栈/顺序栈/stack.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/c/dataStructure/栈和队列/栈/顺序栈/stack.h b/c/dataStructure/栈和队列/栈/顺序栈/stack.h
new file mode 100755
index 0000000..2d63452
--- /dev/null
+++ b/c/dataStructure/栈和队列/栈/顺序栈/stack.h
@@ -0,0 +1,23 @@
+#ifndef _STACK_H
+#define _STACK_H
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<stdbool.h>
+
+#define MAXIMUM 5
+#define RESIZE 1
+
+typedef struct stack {
+ int * base;
+ int * top;
+ int size;
+} Stack;
+
+bool InitStack(Stack * s);
+bool DestroyStack(Stack * s);
+bool Push(Stack * s, int n);
+bool Pop(Stack * s, int * n);
+int GetTop(Stack * s);
+
+#endif \ No newline at end of file