-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack.h
More file actions
37 lines (35 loc) · 980 Bytes
/
Stack.h
File metadata and controls
37 lines (35 loc) · 980 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
#pragma once
#include "MathLibrary.h";
#include <stdlib.h>
#include <string.h>
#ifndef __STACK
typedef struct
{
int totalSize;
int topOfStack;
void** content;
}Stack;
#define __STACK
#endif // !__STACK
//init the stack manager ptr
void InitStack(Stack*,int);
//retruninig and remoaving last inserted value
void* PopStack(Stack*);
//inserting value to last place
void PushStack(Stack*, void*);
//retruninig true if stack is empty
BOOL IsEmptyStack(Stack*);
//makes the stack up side down
void StackReverse(Stack*);
//copys all val in stack to a new one
void CopyStack(Stack*, Stack*);
//retruns true if giving val in stack
//requires a content compring method
BOOL IsInStack(Stack, void*, BOOL(*isEql)(void*, void*));
//return stack length
int StackLength(Stack*);
//empty all vals in stack
void EmpatyStack(Stack*);
//retruns true if equal
//requires a content compring method
BOOL IsEqualStack(Stack, Stack, BOOL (*isEql)(void*,void*));