Compartors doubt

can you explain how returning a boolean value we can change max compartor to min compartor

hi @singhsimran567 can you give some more context? Like which data structure/algoithm do you want to apply the comparator on

like its used in the priority queue video in stl section

@singhsimran567
in priority queues if the comparator is a b a min heap is created

yes but whats the logic being used behind it, compartor just returns a bool (return a<b0

@singhsimran567 i think comparator has been explained in detail in the sorting section, please watch from there

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.