1

How do I write custom sorting for map with such attributes --

map <int, pair<int,int> > Valuedensity

I want to sort with

sort(Valuedensity.begin(),Valuedensity.end(),myfn(int, pair<int,int>))

But I do not how to define this myfn() such that it sorts the map using second element in value pair of map ( el.second.second ).

Mohit Kumar
  • 500
  • 6
  • 24

0 Answers0