Reputation: 1171
If STL map,set are internally using balanced binary search tree for its implementation , should it not be possible to use map or set to represent BBST ?
I need the BBST data structure, can I not use any of the mentioned associative container to implement it or I have do it from scratch ?
Thanks
Upvotes: 1
Views: 794
Reputation:
The data structure is a red black tree, which is self balancing and guarantees you a O(log(n))
time for search/insert/delete. If you need operations beyond the ones that map supports (something like rank and select) you will need to implement your own tree, otherwise you are good to use map.
Upvotes: 1