-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstack.h
More file actions
51 lines (43 loc) · 906 Bytes
/
stack.h
File metadata and controls
51 lines (43 loc) · 906 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
43
44
45
46
47
48
49
50
51
#ifndef __STACK_H
#define __STACK_H
typedef void* Stack;
typedef void* InfoStack;
/*
Cria uma stack
POS: retoan a stack
*/
Stack createStack();
/*
Verifica se a stack está vazia
PRE: stack
POS: 0 se não está vazio e 1 se está
*/
int isEmptyStack(Stack stack);
/*
Retorna o tamanho da stack
PRE: stack
POS: numero de elementos
*/
int sizeStack(Stack stack);
/*
Retorna o primeiro elemento da stack
PRE: stack
POS: elemento
*/
InfoStack topStack(Stack stack);
/*
Insere um novo elemento na stack
PRE: stack e elemento
*/
void pushStack(Stack stack, InfoStack info);
/*
Retira o último elemento da stack
PRE: stack e flag: 1 = desaloca info e 0 = não desaloca
*/
void popStack(Stack stack, int flag);
/*
Desaloca stack
PRE: stack e flag: 1 = desaloca info e 0 = não desaloca
*/
void removeStack(Stack stack, int flag);
#endif