Using vector<int> in priority queue

If we want to implement a priority queue that follows a min heap we are passing vector int as an argument in the priority queue template as an argument.
What is basic functionality that vector int is doing in the priority queue template ?

@souptiksarkar4572
we give the heap a container to store the contents.
for example if we have to make a heap of pair<int,int> we will be passing vector<pair<int,int>>
this tells the priority queue to store the heap in this container.

Okay I got it. But one more thing, during implementation of the default priority queue that is implementing max heap behind the scenes, why we don’t need to pass vector as as argument in the priority queue template ?
Is it by default taking the vector for that case ?
Thank you.

1 Like

Yes it is by default in that case.

Now it becomes clear. Thank you very much.

1 Like