Heaps (also known as priority queues) are data structures that allow efficient element insertion, removal, and removal of the smallest element.
More...
|
|
#define | csnip_heap_SiftUp(u, v, au_lessthan_av, swap_au_av, K, N, i) |
| | Sift an element towards the top (root) of the heap.
|
| |
|
#define | csnip_heap_SiftDown(u, v, au_lessthan_av, swap_au_av, K, N, i) |
| | Sift an element towards the bottom of the heap.
|
| |
|
#define | csnip_heap_Heapify(u, v, au_lessthan_av, swap_au_av, K, N) |
| | Transform an array into a heap.
|
| |
| #define | CSNIP_HEAP_DECL_FUNCS(scope, prefix, gen_args) |
| | Generator macro to declare heap functions. More...
|
| |
| #define | CSNIP_HEAP_DEF_FUNCS(scope, prefix, gen_args, u, v, au_lessthan_av, swap_au_av, K, N) |
| | Generator macro to define heap functions. More...
|
| |
◆ CSNIP_HEAP_DECL_FUNCS
| #define CSNIP_HEAP_DECL_FUNCS |
( |
|
scope, |
|
|
|
prefix, |
|
|
|
gen_args |
|
) |
| |
- Parameters
-
| scope | function scope |
| prefix | function name prefixes |
| gen_args | argument list, either of the form args(...) or noargs(). |
◆ CSNIP_HEAP_DEF_FUNCS
| #define CSNIP_HEAP_DEF_FUNCS |
( |
|
scope, |
|
|
|
prefix, |
|
|
|
gen_args, |
|
|
|
u, |
|
|
|
v, |
|
|
|
au_lessthan_av, |
|
|
|
swap_au_av, |
|
|
|
K, |
|
|
|
N |
|
) |
| |
- Parameters
-
| scope | function scope |
| prefix | function name prefixes |
| gen_args | argument list, either of the form args(...) or noargs(). |
| u,v | dummy variables |
| au_lessthan_av | comparator expression |
| swap_au_av | entry swapping statement |
| K | heap arity (e.g., 2 for binary heaps) |
| N | heap size |