sajis997
sajis997

Reputation: 1171

Balanced Binary Search Tree Implementation

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

Answers (1)

user4233758
user4233758

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

Related Questions