--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
AFAIK, yes, Red Black Trees are one of the most common implementations
for sets, maps and alikes. There are also AVL implementations out there,
that you can google for.
JP
It's necessarily some kind of self-balancing binary tree since that's
the only way to provide the complexity guarantees that are required.
Implementations typically use a red-black tree or an AVL tree.
> How are sets generally implemented in STL. I have read they are
> implemented as BST, are they some kind of balanced BST like Red Black
> trees?
Yes.
--
VH
Well, it depends on ... the implementation :)
> I have read they are
> implemented as BST, are they some kind of balanced BST like Red Black
> trees?
IMO that's the obvious (I dare say intended) implementation. But
nothing prevents the implementer from providing more efficient
structures for specific specialization.
--
Michael
Every implementation I know of uses a red-black tree, although the
standard says nothing about which underlying data type to use.
Joe Gottman