C++ priority_queue push()Last Updated : 17 Mar 2025 C++ prioriy_queue push() function is used to insert an element into a priority queue. The element is added into the priority queue container then the size of the priority queue is increased by 1. Firstly, the element is added at the back and at the same time elements of the priority queue reorder themselves according to priority. SyntaxConsider priority_queue 'pq' as a priority_queue object. ParameterValue: It is used to add value into a priority queue. Return valueNone Example 1Output: poping element e d c b a Example 2Output: poping element: my india Is Great Country Next TopicC++ priority_queue |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India