38#ifndef ALGORITHM_BINARY_HEAP_H
39#define ALGORITHM_BINARY_HEAP_H
73#define BINARY_HEAP_NULL ((void *) 0)
void * BinaryHeapValue
A value stored in a BinaryHeap.
int(* BinaryHeapCompareFunc)(BinaryHeapValue value1, BinaryHeapValue value2)
Type of function used to compare values in a binary heap.
struct _BinaryHeap BinaryHeap
A binary heap data structure.
int binary_heap_num_entries(BinaryHeap *heap)
Find the number of values stored in a binary heap.
int binary_heap_insert(BinaryHeap *heap, BinaryHeapValue value)
Insert a value into a binary heap.
BinaryHeap * binary_heap_new(BinaryHeapType heap_type, BinaryHeapCompareFunc compare_func)
Create a new BinaryHeap.
void binary_heap_free(BinaryHeap *heap)
Destroy a binary heap.
BinaryHeapValue binary_heap_pop(BinaryHeap *heap)
Remove the first value from a binary heap.
@ BINARY_HEAP_TYPE_MAX
A maximum heap.
@ BINARY_HEAP_TYPE_MIN
A minimum heap.