-
Notifications
You must be signed in to change notification settings - Fork 0
/
Queue.h
87 lines (74 loc) · 1.37 KB
/
Queue.h
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
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>
#include <string.h>
typedef struct node {
int* data;
int size;
int count;
int front;
} Queue;
/**
* @brief Create a Queue object
* @return Queue*
*/
Queue* createQueue(int size);
/**
* @brief Destroy the Queue object
* @param queue
*/
void destroyQueue(Queue* queue);
/**
* @brief Check if the queue is empty
* @param queue
* @return true
* @return false
*/
bool isEmpty(Queue* queue);
/**
* @brief Check if the queue is full
* @param queue
* @return true
* @return false
*/
bool isFull(Queue* queue);
/**
* @brief Enqueue an element to the queue
* @param queue
* @param element
*/
void enqueue(Queue* queue, int element);
/**
* @brief Dequeue an element from the queue
* @param queue
* @return int
*/
int dequeue(Queue* queue);
/**
* @brief Get the Front object
* @param queue
* @return int
*/
int getFront(Queue* queue);
/**
* @brief Get the Rear object
* @param queue
* @return int
*/
int getRear(Queue* queue);
/**
* @brief Print the queue
* @param queue
* @return char*
*/
char* printQueue(Queue* queue);
/**
* @brief Get the Size object
* @param queue
* @return int
*/
int getSize(Queue* queue);
#endif