65 #define binaryheap_empty(h) ((h)->bh_size == 0)
66 #define binaryheap_size(h) ((h)->bh_size)
67 #define binaryheap_get_node(h, n) ((h)->bh_nodes[n])
void binaryheap_remove_node(binaryheap *heap, int n)
void binaryheap_build(binaryheap *heap)
void binaryheap_replace_first(binaryheap *heap, bh_node_type d)
void binaryheap_reset(binaryheap *heap)
bh_node_type binaryheap_first(binaryheap *heap)
void binaryheap_add(binaryheap *heap, bh_node_type d)
bh_node_type binaryheap_remove_first(binaryheap *heap)
binaryheap * binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg)
int(* binaryheap_comparator)(bh_node_type a, bh_node_type b, void *arg)
struct binaryheap binaryheap
void binaryheap_free(binaryheap *heap)
void binaryheap_add_unordered(binaryheap *heap, bh_node_type d)
#define FLEXIBLE_ARRAY_MEMBER
static int compare(const void *arg1, const void *arg2)
bool bh_has_heap_property
binaryheap_comparator bh_compare
bh_node_type bh_nodes[FLEXIBLE_ARRAY_MEMBER]