title: c++ heap with removing any element method
body: <p>I am trying to implement my own heap with the method removing any number (not only the min or max) but I can't solve one problem. To write that removing function I need the pointers to the elements in my heap (to have O(logn) time of removing given element). But when I have tried do it this way:</p>
  
  <pre><code>vector&lt;int*&gt; ptr(n);
  </code></pre>
  
  <p>it of course did not work.</p>
  
  <p>Maybe I should insert into my heap another class or structure containing int, but for now I would like to find any solution with int (because I have already implemented it using int)?</p>