112 a->first_child->prev_or_parent =
b;
113 b->prev_or_parent =
a;
114 b->next_sibling =
a->first_child;
216 Assert(*prev_ptr == node);
229 *prev_ptr = replacement;
235 *prev_ptr = next_sibling;
295 newroot =
merge(heap, newroot, curr);
308 #ifdef PAIRINGHEAP_DEBUG
322 dumpfunc(node,
buf, opaque);
325 pairingheap_dump_recurse(
buf, node->
first_child, dumpfunc, opaque, depth + 1, node);
326 prev_or_parent = node;
343 pairingheap_dump_recurse(&
buf, heap->
ph_root, dumpfunc, opaque, 0, NULL);
#define Assert(condition)
static int compare(const void *arg1, const void *arg2)
char * pstrdup(const char *in)
void pfree(void *pointer)
void pairingheap_remove(pairingheap *heap, pairingheap_node *node)
void pairingheap_add(pairingheap *heap, pairingheap_node *node)
static pairingheap_node * merge(pairingheap *heap, pairingheap_node *a, pairingheap_node *b)
pairingheap_node * pairingheap_first(pairingheap *heap)
pairingheap * pairingheap_allocate(pairingheap_comparator compare, void *arg)
void pairingheap_initialize(pairingheap *heap, pairingheap_comparator compare, void *arg)
void pairingheap_free(pairingheap *heap)
pairingheap_node * pairingheap_remove_first(pairingheap *heap)
static pairingheap_node * merge_children(pairingheap *heap, pairingheap_node *children)
#define pairingheap_is_empty(h)
int(* pairingheap_comparator)(const pairingheap_node *a, const pairingheap_node *b, void *arg)
void appendStringInfoSpaces(StringInfo str, int count)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct pairingheap_node * next_sibling
struct pairingheap_node * prev_or_parent
struct pairingheap_node * first_child
pairingheap_comparator ph_compare
pairingheap_node * ph_root