-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkStack.h
47 lines (39 loc) · 1003 Bytes
/
LinkStack.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
41
42
43
44
45
46
/*
* =====================================================================================
*
* Filename: LinkStack.h
*
* Description: Stack的链式存储结构
*
* Version: 1.0
* Created: 11/29/2014 09:06:22 PM
* Revision: none
* Compiler: gcc
*
* Author: 张世龙 (mn), [email protected]
* Company: free
*
* =====================================================================================
*/
#ifndef GIT_JCOMMON_LINKSTACK_H
#define GIT_JCOMMON_LINKSTACK_H
typedef int ElemType;
typedef struct StackNode
{
ElemType data;
struct StackNode *next;
}StackNode,*LinkStackPtr;
typedef struct LinkStack
{
LinkStackPtr top;
int count;
}LinkStack;
void InitStack(LinkStack *s);
void DestoryStack(LinkStack *s);
void ClearStack(LinkStack *s);
int StackEmpty(LinkStack *s);
int GetTop(LinkStack *s,ElemType *e);
void Push(LinkStack *s,ElemType *e);
int Pop(LinkStack *s,ElemType *e);
int StackLength(LinkStack *s);
#endif