Data Structures Lerax  v3.0-104-ge031
Opinionated Data Structures & Algorithms
Loading...
Searching...
No Matches
queue.h
Go to the documentation of this file.
1
12
13#ifndef QUEUE_H
14#define QUEUE_H
15
19typedef struct queue Queue;
20
21#define EMPTY_QUEUE (Queue*) 0
22#ifndef QUEUE_STATIC_MAX
23#define QUEUE_STATIC_MAX 1000000
24#endif
25
33
42
50void queue_insert(Queue *q, int data);
51
60
68
77
85
93
104
113
114
115#endif
void queue_print(Queue *q)
Prints the elements of a queue to the console.
int queue_evens(Queue *q)
Counts the number of even elements in a queue.
void queue_reverse(Queue *q)
Reverses the elements of a queue.
void queue_insert(Queue *q, int data)
Inserts an element at the back of a queue.
int queue_remove(Queue *q)
Removes and returns the element at the front of a queue.
int queue_greater_than(Queue *q, int n)
Counts the number of elements in a queue that are greater than a given value.
void queue_free(Queue *q)
Frees the memory allocated for a queue.
Queue * queue_create(void)
Creates an empty queue.
void queue_println(Queue *q)
Prints the elements of a queue to the console, followed by a newline character.
int queue_empty(Queue *q)
Checks if a queue is empty.
struct queue Queue
A queue data structure.
Definition queue.h:19