STL map internal implementation.

Dec 1, 2011 at 6:35am
I was searching how map is internally implemented in STL.I am so glad if someone can help me on that.
Please share code also if you have.

Thanks,
Deepesh C.P

Dec 1, 2011 at 6:36am
It's often implemented as a self-balancing binary search tree.
Dec 1, 2011 at 6:37am
Dec 1, 2011 at 6:38am
Can you share code to know how it is really implemented?
Dec 1, 2011 at 6:41am
Thanks for your replay. I will go through that. If you can some code Please share that also.
Dec 1, 2011 at 6:47am
By STL, do you mean the old library by SGI or the standard library?

If you mean std::map in the standard library there exist a number of different implementations. Here is the code for std::map in gcc: http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/bits/stl_map.h?revision=181394&view=markup
Dec 1, 2011 at 6:52am
Thanks.....
Dec 1, 2011 at 5:31pm
The code for these templates is normally present in the header files you use, just check them out !
Topic archived. No new replies allowed.