The number of elements less then x

Revision en2, by Bur, 2019-02-03 18:17:31

This problem I meet very often: there is a set, in which we can add element, also we can erase any element. The problem is to count the number of elements less then x.

Sure, the problem can be solved with treap or something like that, but can it be solved with std::set or other already released data structures?

Any ideas?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Bur 2019-02-03 18:17:31 5 Tiny change: 's problem that I meet ve' -> 's problem I meet ve'
en1 English Bur 2019-02-03 18:10:00 373 Initial revision (published)