Comparator & functor

sir what is the difference between comparator and functor?
and when do we use each of them?
in priority queue ,we have used functor , and in the vector class we have used comparator although aboth of them are a part of STL library?!!

Hey @mzk1994
Refer to Functor vs Custom Comparator
Let me know if u dont understand something

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.