Why we are doing operator overloading in line 25 - 30? Also, why vector is passed as parameter in line 35?
Doubt in Priority Queue for custom class
hello @gambhirrahul0
we are making functor to compare custom classes without defining it pq cant compare objects of custom class.
vector is container used by priority queue internally and becuase this time we are storing person objects in pq we have passed vector < person > as its container
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.