-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.c
More file actions
60 lines (48 loc) · 805 Bytes
/
Copy pathstack.c
File metadata and controls
60 lines (48 loc) · 805 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
52
53
54
55
56
57
58
59
/*
* Generic Stack ADT: private implementation
*
* Author: Joseph Fall
* Date: Mar. 1, 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <limits.h>
#include "stack.h"
Stack_t stackCreate()
{
return llCreate();
}
void stackDestroy(Stack_t* stack)
{
llDestroy(stack);
}
void stackPrint(const Stack_t stack)
{
llPrint(stack);
}
bool stackIsEmpty(const Stack_t stack)
{
return llIsEmpty(stack);
}
void stackPopAll(Stack_t* stack)
{
llDelete(stack);
}
int stackSize(const Stack_t stack)
{
return llLength(stack);
}
void stackPush(Stack_t* stack, ItemType value)
{
llPush(stack, value);
}
ItemType stackTop(const Stack_t stack)
{
return llHead(stack);
}
ItemType stackPop(Stack_t* stack)
{
return llPop(stack);
}