title: Is there a sorted data structure with logarithmic time insertion, deletion and find (with distance)?
body: <p>I have a sorted array in which I find number of items less than particular value using binary search (<code>std::upper_bound</code>) in <code>O(logn)</code> time.<br>
  Now I want to insert and delete from this array while keeping it sorted. I want the overall complexity to be <code>O(logn)</code>. </p>
  
  <p>I know that using binary search tree or <code>std::multiset</code> I can do insertion, deletion and upper_bound in <code>O(logn)</code> but I am not able do get the distance/index (<code>std::distance</code> is <code>O(n)</code> for sets) in logarithmic time.</p>
  
  <p>So is there a way to achieve what I want to do?</p>