title: How to get the maximum/minimum value from a SortedDictionary?
body: <p>I have built a <code>SortedDictionary&lt;int, FlowLayoutPanel&gt; panels</code> as prescribed. I currently am looping over the dictionary like so </p>
  
  <pre><code>foreach (var key in panels.Keys.ToList())
  {
      FlowLayoutPanel tallestPanel = panels[key];
  }
  </code></pre>
  
  <p>to get the entry with the maximum key value. I am trying to now write another loop that continually applies an operation until the <code>Count</code> of the dictionary is 0. Within this loop I need to get the maximum and minimum value from the dictionary on each iteration. I have read over the <a href="http://msdn.microsoft.com/en-us/library/f7fta44c%28v=vs.110%29.aspx" rel="nofollow"><code>SortedDictionary</code> MSDN</a> entry and it looks like I need to use linq to accomplish this. Is this true? How would I do that? (I've never touched linq)</p>
  
  <p>And a bonus question that I can't find a good answer to, do <code>SortedDictionaries</code> sort from largest to smallest value i.e. if the <code>int</code> in <code>&lt;int, FlowLayoutPanel&gt;</code> represented the <code>FlowLayoutPanels.Height</code>, would the loop above continually give me the tallest panel?</p>