摘要:
刚下班没事干,实现了一个简单的优先级队列#include #include typedef void (*pqueue_setindex) (void *obj, int pq_index);typedef int (*pqueue_cmp) (void* obj1, void* obj2);typedef struct pqueue_struct{ void **heap; int numelem; pqueue_setindex setindex; pqueue_cmp cmp;}pqueue;pqueue* pqueue_new(int pq_size, pqueue_setinde.. 阅读全文