I use maps...But i wanted the map to be sorted in decreasing order of the key value... wat spiece of code should i add to change the comparator to the following
Code:multimap<double,long long int> mymap; multimap<double,long long int>::iterator it;
This is a discussion on Map within the C++ Programming forums, part of the General Programming Boards category; I use maps...But i wanted the map to be sorted in decreasing order of the key value... wat spiece of ...
I use maps...But i wanted the map to be sorted in decreasing order of the key value... wat spiece of code should i add to change the comparator to the following
Code:multimap<double,long long int> mymap; multimap<double,long long int>::iterator it;
The third template parameter to (multi)map is the comparison object. You can use std::greater.
S i know that third is its keycomparator...but i am not sure of gthe way to add it in the code...It gives me error...
can u just give me the snippet of how the declaration would look like
Off the top of my head, it's probablyCode:std::multimap<type_key, type_value, std::greater<type> >
long time; /* know C? */
Unprecedented performance: Nothing ever ran this slow before.
Any sufficiently advanced bug is indistinguishable from a feature.
Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
The best way to accelerate an IBM is at 9.8 m/s/s.
recursion (re - cur' - zhun) n. 1. (see recursion)
Are you sure you even need to do that?
You can iterate over the container from rbegin() to rend(), which might be enough in your circumstances.