Functioning of greater<int>

Why does this function works differently for priority queue and differently for sort function

@shrey_codes,
It’s just how things are implemented in STL. In priority_queue, comparator is used to decide what will stay on top, but in sort comparator is used to decide, what will come before(left). You can just memoize it as a fact.