Different ways to add elements in Priority queue in C++

Different ways to add elements in Priority queue in C++

Priority Queue is an STL container. Primarily a container adapter which stores the greatest element at the top; a max-heap.

It is an adapter which uses a vector by default as an underlying container, but a deque can also be used. In this article, we have explored Different ways to add elements in Priority queue container in C++.


Library: queue
1. Using push()
void push (const value_type& val);
void push (value_type&& val);


This method inserts a new element to the container and initializes it ...
 •  0 comments  •  flag
Share on Twitter
Published on July 22, 2020 14:08
No comments have been added yet.