data structures - C++ STL container suited for finding the nth element in dynamic ordered list? -


using balanced bst avl or red-black-tree, can maintain set of values that:

  1. insert/delete/query given value.
  2. count elements smaller/larger given value.
  3. find element rank k after sort.

all above can archived in o(log n) complexity.

my question is, there stl container supporting 3 above operations in same complexity?

i know stl set/multiset can used 1 , 2. , examined _rb_tree based containers map/set/multiset, none provides support 3. there way subclassing ext/rb_tree solve this?


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -