Functions

src/pqueue.c File Reference

#include "pqueue.h"
#include "helper.h"

Go to the source code of this file.

Functions

void pq_free (PriorityQueue *pq)
PriorityQueuepq_init ()
void pq_insert (PriorityQueue *pq, void *c, double prior)
void * pq_pop (PriorityQueue *pq)
PQnode * pq_pop_node (PriorityQueue *pq)
void pq_print (FILE *out, PriorityQueue *pq)
PQnode * pqnode_init (void *c, double priority)

Function Documentation

void pq_free ( PriorityQueue pq  ) 

Definition at line 126 of file pqueue.c.

PriorityQueue* pq_init (  ) 

TEMPLATE

Parameters:
\param 
Returns:

Definition at line 29 of file pqueue.c.

void pq_insert ( PriorityQueue pq,
void *  c,
double  prior 
)

Definition at line 44 of file pqueue.c.

void* pq_pop ( PriorityQueue pq  ) 

pop the data with highest priority in the PQ. if you need access to the priority as well, use pq_pop_node(). The corresponding node is removed from the PQ;

Parameters:
pq the PQ

Definition at line 91 of file pqueue.c.

PQnode* pq_pop_node ( PriorityQueue pq  ) 

pop a node in the PQ. use it if you need access to the priority value as well. You will need to free the node after usage yourself;

Parameters:
pq the PQ

Definition at line 74 of file pqueue.c.

void pq_print ( FILE *  out,
PriorityQueue pq 
)

Definition at line 103 of file pqueue.c.

PQnode* pqnode_init ( void *  c,
double  priority 
)

Definition at line 35 of file pqueue.c.