What is the use of vector argument passing in min priority queue and Priority queue using comparator class

What is the use of vector argument passing in min priority queue and Priority queue using comparator class
Eg: priority_queue < int, vector < int > ,greater > pq ;
// for min priority queue
priority_queue< int,vector< Person> ,PersonComparator> pq;
// for person comparator

In this what we are doing is making comparator (person comparator)for priority queue , according to which it will sort.

Because std::priority_queue is a class template defined as follows:

template<
    class T,
    class Container = std::vector<T>,
    class Compare = std::less<typename Container::value_type>
> class priority_queue;

As you can see, you can instantiate this class only providing the T , because the rest of the types will be defaulted. You can read more about template default arguments here.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.