why we use comparator class inside the multiset to arrange by multiset<pair<string,int>,person_compare>m;
and it sorted according to their values…
Why we use comparator class inside the multiset to
@AMIT_KUMAR,
Because that’s what multisets do, sort the inserted keys in the order decided by comparator class.
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.