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