#include "util.h"
Go to the source code of this file.
Defines | |
#define | Heap_HeapForEachItem(heap,i,data) |
Typedefs | |
typedef struct HeapSlot | HeapSlot_t |
typedef struct Heap | Heap_t |
Functions | |
EXTERN Heap_t *Heap_HeapInit | ARGS ((int length)) |
EXTERN Heap_t *Heap_HeapInitCompare | ARGS ((int length, int(*compare)(const void *, const void *))) |
EXTERN void Heap_HeapFree | ARGS ((Heap_t *heap)) |
EXTERN int Heap_HeapInsert | ARGS ((Heap_t *heap, void *item, long key)) |
EXTERN int Heap_HeapExtractMin | ARGS ((Heap_t *heap, void *item, long *key)) |
EXTERN Heap_t *Heap_HeapClone | ARGS ((Heap_t *source)) |
EXTERN void | Heap_HeapApplyForEachElement (Heap_t *heap, int(*compare)(const void *)) |
#define Heap_HeapForEachItem | ( | heap, | |||
i, | |||||
data | ) |
typedef struct HeapSlot HeapSlot_t |
CFile***********************************************************************
FileName [heap.h]
PackageName [heap]
Synopsis [Heap-based priority queue.]
Description [This is the external header file for the heap-based priority queue. The priority of each item is determined by an integer key. The first element of the heap is the one with the smallest key. Multiple items with the same key can be inserted. Refer to Chapter 7 of Cormen, Leiserson, and Rivest for the theory. (The only significant difference is that the array indices start from 0 in this implementation.)]
SeeAlso []
Author [Fabio Somenzi]
Copyright [This file was created at the University of Colorado at Boulder. The University of Colorado at Boulder makes no warranty about the suitability of this software for any purpose. It is presented on an AS IS basis.]
Revision [
]
EXTERN int Heap_HeapExtractMin ARGS | ( | (Heap_t *heap, void *item, long *key) | ) |
EXTERN int Heap_HeapInsertCompare ARGS | ( | (Heap_t *heap, void *item, long key) | ) |
EXTERN int Heap_HeapTestCompare ARGS | ( | (Heap_t *heap) | ) |
EXTERN Heap_t* Heap_HeapInitCompare ARGS | ( | (int length, int(*compare)(const void *, const void *)) | ) |
EXTERN Heap_t* Heap_HeapInit ARGS | ( | (int length) | ) |
AutomaticStart
EXTERN void Heap_HeapApplyForEachElement | ( | Heap_t * | heap, | |
int(*)(const void *) | compare | |||
) |
Function********************************************************************
Synopsis [Apply function for each element of heap.]
Description [Apply function for each element of heap. Returns 1 if successful; 0 otherwise.]
SideEffects [ ]
SeeAlso [ ]