|
priority_queue::poppublic member function
void pop ( ); Remove top element Removes the element on top of the priority_queue, effectively reducing its size by one. The value of this element can be retrieved before being popped by calling member priority_queue::top.This calls the removed element's destructor. This member function effectively calls the pop_heap algorithm to keep the heap property of priority_queues and then calls the member function pop_back of the underlying container object to remove the element. ParametersnoneReturn valuenoneExample
Output:
ComplexityConstant (in the priority_queue). Although notice that pop_heap operates on logarithmic time.See also
|