-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
42 lines (33 loc) · 661 Bytes
/
stack.h
File metadata and controls
42 lines (33 loc) · 661 Bytes
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
//
// stack.h
// PrefixEvalAndTrans
//
// Created by 이재원 on 14/05/2019.
// Copyright © 2019 Jae Won. All rights reserved.
//
#ifndef stack_h
#define stack_h
#include <stdio.h>
#include <stdlib.h>
#define MAX_EXPR_LEN 100
typedef union{
int key;
char strKey[MAX_EXPR_LEN];
}element;
typedef struct{
int capacity;
int top;
element* stc;
}stack;
typedef enum{
True = 1, False = 0
}Boolean;
void allocStack(stack** s);
Boolean isEmpty(stack s);
Boolean isFull(stack s);
void stackFull(stack* s);
void stackEmpty(void);
void push(stack* s, element e);
element pop(stack* s);
void stackFree(stack**s);
#endif /* stack_h */