Data Structures Lerax  v3.0-101-gb1f7
Opinionated Data Structures & Algorithms
Loading...
Searching...
No Matches
queue.h File Reference

Go to the source code of this file.

Macros

#define EMPTY_QUEUE   (Queue*) 0
#define QUEUE_STATIC_MAX   1000000

Typedefs

typedef struct queue Queue
 A queue data structure.

Functions

Queuequeue_create (void)
 Creates an empty queue.
int queue_empty (Queue *q)
 Checks if a queue is empty.
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.
void queue_print (Queue *q)
 Prints the elements of a queue to the console.
void queue_println (Queue *q)
 Prints the elements of a queue to the console, followed by a newline character.
void queue_free (Queue *q)
 Frees the memory allocated for a queue.
void queue_reverse (Queue *q)
 Reverses the elements 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.
int queue_evens (Queue *q)
 Counts the number of even elements in a queue.

Macro Definition Documentation

◆ EMPTY_QUEUE

#define EMPTY_QUEUE   (Queue*) 0

◆ QUEUE_STATIC_MAX

#define QUEUE_STATIC_MAX   1000000

Typedef Documentation

◆ Queue

typedef struct queue Queue

A queue data structure.


    Copyright 2017-2025 Manoel Vilela

    Author: Manoel Vilela
   Contact: manoel_vilela@engineer.com

Organization: UFC