1 #ifndef CMR_HEAP_INTERNAL_H
2 #define CMR_HEAP_INTERNAL_H
83 return heap->
size == 0;
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
CMR_ERROR CMRintheapInsert(CMR_INTHEAP *heap, int key, int value)
Inserts a key value pair into the heap.
Definition: heap.c:62
static int CMRintheapGetValue(CMR_INTHEAP *heap, int key)
Definition: heap.h:124
CMR_ERROR CMRintheapDecreaseInsert(CMR_INTHEAP *heap, int key, int newValue)
Decreases the value of key to newValue or inserts it.
Definition: heap.c:137
int CMRintheapExtractMinimum(CMR_INTHEAP *heap)
Extracts the minimum element and returns its key.
Definition: heap.c:184
CMR_ERROR CMRintheapClearStack(CMR *cmr, CMR_INTHEAP *heap)
Clears the given heap.
Definition: heap.c:29
CMR_ERROR CMRintheapInitStack(CMR *cmr, CMR_INTHEAP *heap, int memKeys)
Initializes an empty heap using stack memory.
Definition: heap.c:9
CMR_ERROR CMRintheapDecrease(CMR_INTHEAP *heap, int key, int newValue)
Decreases the value of key to newValue.
Definition: heap.c:103
static int CMRintheapGetValueInfinity(CMR_INTHEAP *heap, int key)
Reutrns the value of key or INT_MAX if there is no such element.
Definition: heap.h:137
static bool CMRintheapContains(CMR_INTHEAP *heap, int key)
Returns true if an element with key is present in the heap.
Definition: heap.h:115
static int CMRintheapMinimumValue(CMR_INTHEAP *heap)
Returns the value of the minimum element.
Definition: heap.h:103
static int CMRintheapMinimumKey(CMR_INTHEAP *heap)
Returns the key of the minimum element.
Definition: heap.h:91
static bool CMRintheapEmpty(CMR_INTHEAP *heap)
Returns true if the heap is empty.
Definition: heap.h:79
Definition: env_internal.h:45
Structure for min-heap with unsigned int values.
Definition: heap.h:17
int memKeys
Memory for keys.
Definition: heap.h:19
int * positions
Array that maps keys to heap positions.
Definition: heap.h:21
int * data
Array that maps heap positions to keys.
Definition: heap.h:22
int size
Current size of the heap.
Definition: heap.h:18
int * values
Array that maps keys to values.
Definition: heap.h:20