
typedef struct PQ
	{
	char *heap;
	char *bottom;
	int nitems;
	int maxitem;
	int itemsize;
	int (*cmp)();
	int (*swap)();
	} PQ;

extern  void reheap_down(struct PQ *p);
extern  void reheap_up(struct PQ *p);
extern  struct PQ *pq_create(int numele,int elesize,int (*cmp)(),void (*swap)(),void *initheap);
extern  int pq_ins(struct PQ *p,void *item);
extern  int pq_del(struct PQ *p,void *target);
extern  char *pq_look(struct PQ *p);
extern  int pq_numele(struct PQ *p);
