-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueueAsArray.c
executable file
·75 lines (64 loc) · 1.96 KB
/
queueAsArray.c
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* ===========================================================
* Name:
* Section:
* Project: Queue ADT implemented with C array
* ===========================================================
*/
#include "queueAsArray.h"
#include <stdio.h>
#include <stdlib.h>
/** enqueue() - adds an element to the back of the queue
* @param queue - a ptr to the queue structure
* @param element - the item to add to the queue
* @return 1 on success, -1 on failure
*/
int enqueue(QueueAsArray* queue, int element) {
return -1;
}
/** dequeue() - removes an element from the front of the queue
* @param queue - a ptr to the queue structure
* @return - the top of the queue on success, -1 on failure
*/
int dequeue(QueueAsArray* queue) {
return -1;
}
/** queueIsEmpty() - determines if the queue is empty
* @param queue - a ptr to the queue structure
* @return - true if the queue is empty or false
*/
bool queueIsEmpty(QueueAsArray* queue) {
return true;
}
/** queueIsFull() - determines if the queue is full
* @param queue - a ptr to the queue structure
* @return - true if the queue is full or false
*/
bool queueIsFull(QueueAsArray* queue) {
return true;
}
/** queueInit() - initializes the queue structure
* @param queue - a ptr to the queue structure
*/
void queueInit(QueueAsArray* queue) {
}
/** queuePeek() - returns the item on the front of the
* queue but doesn't remove it
* @param queue - a ptr to the queue structure
* @return - the item at the front of the queue or -1 on failure
*/
int queuePeek(QueueAsArray* queue) {
return -1;
}
/** queueSize() - determines the size of the queue
* @param queue - a ptr to the queue structure
* @return - number of items in the queue
*/
int queueSize(QueueAsArray* queue) {
return -1;
}
/** queuePrint() - outputs the queue to the console
* @param queue - ptr to the queue structure
*/
void queuePrint(QueueAsArray* queue) {
}