title: Sorting of STL map in c++ based on value
body: <p>I've a follwing map:</p>
  
  <pre><code>map&lt;int, int&gt; mp;
  mp[11] = 5;
  mp[3] = 7;
  mp[1] = 3;
  </code></pre>
  
  <p>If I iterate over map like:</p>
  
  <pre><code>for(auto it: mp) {
      cout&lt;&lt;it.first&lt;&lt;" "&lt;&lt;it.second&lt;&lt;'\n';
  }
  </code></pre>
  
  <p>Then the output will be:</p>
  
  <pre><code>1 3
  3 7
  11 5
  </code></pre>
  
  <p>But I want which key has the greater value that key will appear first.
  Example output for the case:</p>
  
  <pre><code>3 7
  11 5
  1 3
  </code></pre>
  
  <p>How can I do this?</p>