Data Structures UFC  1.0.0
Essential Data Structures for C language
queue.h
Go to the documentation of this file.
1 
13 #ifndef QUEUE_H
14 #define QUEUE_H
15 
16 typedef struct queue Queue;
17 
18 #define EMPTY_QUEUE (Queue*) 0
19 #define QUEUE_STATIC_MAX 10
20 
24 Queue* queue_create(void);
25 
29 int queue_empty(Queue *q);
30 
34 void queue_insert(Queue *q, int data);
35 
39 int queue_remove(Queue *q);
40 
44 void queue_print(Queue *q);
45 
49 void queue_println(Queue *q);
50 
54 void queue_free(Queue *q);
55 
59 void queue_reverse(Queue *q);
60 
64 int queue_greater_than(Queue *q, int n);
65 
69 int queue_evens(Queue *q);
70 
71 
72 #endif
void queue_print(Queue *q)
Print the queue (wthout newline)
int queue_remove(Queue *q)
Remove and return the first element on the queue.
void queue_free(Queue *q)
Free memory of thequeue structure.
void queue_reverse(Queue *q)
Reverse the elemens of the queue.
int queue_evens(Queue *q)
Count the number o even elements on Queue.
void queue_insert(Queue *q, int data)
Insert a new elemet on the queue.
void queue_println(Queue *q)
Print the queue (wth a newline)
int queue_greater_than(Queue *q, int n)
Count the number o elements greater than n.
struct queue Queue
Definition: queue.h:16
Queue * queue_create(void)
Create a new queue.
int queue_empty(Queue *q)
Check if the queueis empty.