data_structures
|
Go to the source code of this file.
Typedefs | |
typedef t_array | t_min_pq |
A priority queue of generic keys. More... | |
Functions | |
t_min_pq * | min_pq_new (const t_type *type) |
Initializes a new empty priority queue. More... | |
void * | min_pq_peek (const t_min_pq *pq) |
Returns the smallest key in the queue. More... | |
void * | min_pq_pop (t_min_pq *pq) |
Removes and returns the smallest key in this queue. More... | |
void | min_pq_add (t_min_pq *pq, const void *data) |
Adds a copy of the specified element to the queue. More... | |
size_t | min_pq_size (const t_min_pq *pq) |
Returns the number of keys in this queue. More... | |
void | min_pq_delete (t_min_pq *pq) |
Deletes this queue and free all its items and the associated data. More... | |
t_min_pq * | min_pq_copy (const t_min_pq *pq) |
Copies the queue and all it contents. More... | |
void min_pq_add | ( | t_min_pq * | pq, |
const void * | data | ||
) |
Adds a copy of the specified element to the queue.
data | The element to be copied |
Definition at line 30 of file min_pq_add.c.
Copies the queue and all it contents.
Definition at line 16 of file min_pq_copy.c.
void min_pq_delete | ( | t_min_pq * | pq | ) |
Deletes this queue and free all its items and the associated data.
Definition at line 16 of file min_pq_delete.c.
Initializes a new empty priority queue.
type | The type of items that this queue can hold |
cmp
function). Definition at line 16 of file min_pq_new.c.
void* min_pq_peek | ( | const t_min_pq * | pq | ) |
Returns the smallest key in the queue.
NULL
if the queue is empty. Definition at line 16 of file min_pq_peek.c.
void* min_pq_pop | ( | t_min_pq * | pq | ) |
Removes and returns the smallest key in this queue.
NULL
if the array is empty. Definition at line 38 of file min_pq_pop.c.
size_t min_pq_size | ( | const t_min_pq * | pq | ) |
Returns the number of keys in this queue.
Definition at line 16 of file min_pq_size.c.