I assume that you are linking to cplusplus.com .
Previously written on the page:
This member function effectively calls the push_back member function of the main container object, and then calls the push_heap algorithm to preserve the heap property priority_queues.
Thus, after pressing O(1) the data structure has lost its heap property, and then always follows it with O(log N) call to restore this property. In other words, operation O(1) is only one part of the whole operation; the complete operation is O(1) + O(log N) , which coincides with O(log N) .
I assume that they mention that the priority is the adapter, and they are trying to emphasize the difference between what the base container does versus what the adapter does.
R Samuel Klatchko
source share