summaryrefslogtreecommitdiff
path: root/c/dataStructure/栈和队列//链栈/stack.h
blob: 33e9ffe3c0f29e17a8ccdcf099e1c016b90a8b89 (plain)
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
#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