Mission Base

Program Base Library Functions

void pblHeapConstruct

( PblHeap* heap )

Constructs a heap using 'bottom-up heap construction'.

Documentation

Constructs a heap using 'bottom-up heap construction'.

This function has a time complexity of O(N), with N being the number of elements in the heap.

This function together with pblHeapAddLast() 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 pblHeapAddLast(), and finally ensure the heap condition with a call to this function.

Parameters:
heap - The heap to use

Alphabetic index



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