Mission Base

Program Base Library Functions

int pblHeapAddLast

( PblHeap* heap, void* element )

Adds the element to the end of the heap without ensuring the heap condition.

Documentation

Adds the element to the end of the heap without ensuring the heap condition.

This function has a time complexity of O(1).

This function together with pblHeapConstruct() can be used to build a heap with N elements in time proportional to N.

First create an empty heap with pblHeapNew() and ensure the heap has space for N elements via a call to pblHeapEnsureCapacity(), then add all elements via calls to this function and finally ensure the heap condition with a call to pblHeapConstruct().

Parameters:
heap - The heap to use
element - Element to be added to the heap
Returns:
int rc >= 0: The size of the heap.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.

Alphabetic index



This page was generated with the help of DOC++.