I wanted to know , how is the MAP available in C++ , not MultiMap just simple Map , implemented internally .
What i could best think of is :
For Integer Mapping : A Balanced Binary Search Tree could be used .
For String Mapping : Compressed Trie or something similar could be used .
I am really curious , how is it really implemented in STL Map .Is some hashing function employed or is it something totally different from this .
std::mapis commonly implemented using a Red-black tree andstd::unordered_mapis a Hash table.<map>- where that is, depends on your compiler and installation.map, since the keys must be ordered. Binary search trees are common; specifically, the GNU and (I think) MS implementations use a red-black tree. Hashing is used forunordered_map(orhash_map, as it was known in the prehistoric STL).