-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stack.h
40 lines (34 loc) · 882 Bytes
/
Stack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* =====================================================================================
*
* Filename: Stack.h
*
* Description: 顺序存储结构栈
*
* Version: 1.0
* Created: 11/29/2014 08:23:24 PM
* Revision: none
* Compiler: gcc
*
* Author: 张世龙 (mn), [email protected]
* Company: free
*
* =====================================================================================
*/
#ifndef GIT_JCOMMON_STACK_H
#define GIT_JCOMMON_STACK_H
#define MAXSIZE 20
typedef int ElemType;
typedef struct{
ElemType data[MAXSIZE];
int top;
}SqStack;
void InitStack(SqStack *s);
void DestoryStack(SqStack *s);
void ClearStack(SqStack *s);
int StackEmpty(SqStack *s);
int GetTop(SqStack *s,ElemType *e);
int Push(SqStack *s,ElemType *e);
int Pop(SqStack *s,ElemType *e);
int StackLength(SqStack *s);
#endif