Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
minpq.h
Go to the documentation of this file.
00001 
00010 #ifndef MINPQ_H
00011 #define MINPQ_H
00012 
00013 #include <stdlib.h>
00014 
00015 
00016 /******************************* Defs and macros *****************************/
00017 
00018 /* initial # of priority queue elements for which to allocate space */
00019 #define MINPQ_INIT_NALLOCD 512
00020 
00021 /********************************** Structures *******************************/
00022 
00024 struct pq_node
00025 {
00026   void* data;
00027   int key;
00028 };
00029 
00030 
00032 struct min_pq
00033 {
00034   struct pq_node* pq_array;    /* array containing priority queue */
00035   int nallocd;                 /* number of elements allocated */
00036   int n;                       
00037 };
00038 
00039 
00040 /*************************** Function Prototypes *****************************/
00041 
00045 extern struct min_pq* minpq_init();
00046 
00047 
00057 extern int minpq_insert( struct min_pq* min_pq, void* data, int key );
00058 
00059 
00069 extern void* minpq_get_min( struct min_pq* min_pq );
00070 
00071 
00081 extern void* minpq_extract_min( struct min_pq* min_pq );
00082 
00083 
00089 extern void minpq_release( struct min_pq** min_pq );
00090 
00091 
00092 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:27 for Jafar by doxygen 1.7.6.1
LAAS-CNRS