suppose i make a priority queue , priority_queue< pair<int,int> > a; now i want to priortize this on basis of second element of pair, how will i do so
Priority queue declaration
@LP19DPPM0141,
A good trick to do that, is to store the value you want to store in pairs in opposite manner,
like for eg instead of doing q.push{a,b} do q.push({b,a}), this will make b the first element in queue and automatically prioritise it.
And well obviously we always have the boring custom comparator thing possible… 
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.
could you also discuss the comparator thing please?
@LP19DPPM0141,
Try to understand and use the trick I have explained above, complicating simple things only leads to confusion. A good practice is to use custom comparator, only when its utmost needed, else your code maybe more bug prone. We will use and understand comparator for pairs, when it would be explicitly needed. And I am sure, it would be highly rare for you as a beginner.
And if you do find something like that, you can always ask here again.