Name

pqueue_extract

Synopsis

int pqueue_extract(PQueue *pqueue, void **data);

Return Value

0 if extracting the element is successful, or -1 otherwise.

Description

Extracts the element at the top of the priority queue specified by pqueue. Upon return, data points to the data stored in the element that was extracted. It is the responsibility of the caller to manage the storage associated with the data.

Complexity

O (lg n), where n is the number of elements in the priority queue.

Get Mastering Algorithms with C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.