I am trying to understand what my comparator should return for a Priority Queue of vectors where I want a min-heap based on third element.
On searching , I found out that the comparator looks like :
bool operator()(vector<int>a, vector<int> b)
{
return a[2]>b[2];
}
Why not a[2]<b[2]?