Function of greater <int> comparator

if we use greater comparator with sort function it sorts i descending order bbut in priority queue it is just opposite why is it so?

@be10046.19 bro its just syntax sort function default is ascending and priority queue default is desc so use of greater swaps there nature . so no need to think about it just remember it. its made that way.
dont forget to hit like and mark the doubt resolved if cleared :smiley:

1 Like