Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have some questions in mind about map and multimap.

    • I know that STL use height-balanced-binary-search tree for MAP implementation but what is actually used for multimap.
    • multimap can also use the same thing with a list in each node for a key. Am I right?
    • How do I give a iterator functionality in a tree structure as in maps and multimaps as in tree it's hard to go through data sequentially.


It will be very helpful if these questions can be answered.

BR,
Akash
Posted
Updated 1-Jun-10 2:00am
v3

1 solution

1) Have a look in the source code of your compiler's version of the standard library.

Having said that just because a particular version of the standard library does things one way doesn't mean that others can't do something radically different.

2) If something has a comparison operator of some sort it can usually be used as the key of a map or multimap.

3) Use the built in iterators - don't try and cook your own

Cheers,

Ash
 
Share this answer
 
Comments
AkashAg 1-Jun-10 8:01am    
Hi,

I am not trying to make my own iterator but I am a bit curious how it is designed generally.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900