Mission Base

Program Base Library Functions

void pblPriorityQueueConstruct

( PblPriorityQueue* queue )

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

Documentation

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

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

This function together with pblPriorityQueueAddLast() can be used to build a priority queue with N elements in time proportional to N.

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

Parameters:
queue - The queue to use

Alphabetic index



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