data_structures
|
Go to the source code of this file.
Typedefs | |
typedef t_array | t_max_pq |
A priority queue of generic keys. More... | |
Functions | |
t_max_pq * | max_pq_new (const t_type *type) |
Initializes a new empty priority queue. More... | |
void * | max_pq_peek (const t_max_pq *pq) |
Returns the largest key in the queue. More... | |
void * | max_pq_pop (t_max_pq *pq) |
Removes and returns the largest key in this queue. More... | |
void | max_pq_add (t_max_pq *pq, const void *data) |
Adds a copy of the specified element to the queue. More... | |
size_t | max_pq_size (const t_max_pq *pq) |
Returns the number of keys in this queue. More... | |
void | max_pq_delete (t_max_pq *pq) |
Deletes this queue and free all its items and the associated data. More... | |
t_max_pq * | max_pq_copy (const t_max_pq *pq) |
Copies the queue and all it contents. More... | |
void max_pq_add | ( | t_max_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 max_pq_add.c.
Copies the queue and all it contents.
Definition at line 16 of file max_pq_copy.c.
void max_pq_delete | ( | t_max_pq * | pq | ) |
Deletes this queue and free all its items and the associated data.
Definition at line 16 of file max_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 max_pq_new.c.
void* max_pq_peek | ( | const t_max_pq * | pq | ) |
Returns the largest key in the queue.
NULL
if the queue is empty. Definition at line 16 of file max_pq_peek.c.
void* max_pq_pop | ( | t_max_pq * | pq | ) |
Removes and returns the largest key in this queue.
NULL
if the array is empty. Definition at line 38 of file max_pq_pop.c.
size_t max_pq_size | ( | const t_max_pq * | pq | ) |
Returns the number of keys in this queue.
Definition at line 16 of file max_pq_size.c.