title: Which is the appropriate data structure?
body: <p>I need a Java data structure that has:</p>
  
  <ul>
  <li>fast (O(1)) insertion</li>
  <li>fast removal</li>
  <li>fast (O(1)) <code>max()</code> function</li>
  </ul>
  
  <p>What's the best data structure to use?</p>
  
  <p>HashMap would almost work, but using <code>java.util.Collections.max()</code> is at least O(n) in the size of the map.  TreeMap's insertion and removal are too slow.</p>
  
  <p>Any thoughts?</p>