Functors need didnot get it

This could have been done using Class and a normal function also.

@PoojaSingh22
The priority queue class , and several other STL classes expect a functor parameter in one of their templates. The functor to be passed, as per the regulations , must be a class or a structure name which has an overloaded () - parentheses operator with boolean type.
These are the rules. If you were to pass a class without this overloaded () operator or were it to say , void data type, you would end up getting an error.

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.