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:
- insert/delete/query given value.
- count elements smaller/larger given value.
- 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
Post a Comment