How are keys stored and searched in a STL std::map? What is the data structure used to store keys (or values also) in map and what algorithm is used to search the keys in std::map?
Asked
Active
Viewed 85 times
-3
AbcAeffchen
- 13,612
- 15
- 48
- 65
Sulla
- 7,163
- 7
- 43
- 68
-
[What is the map data structure in C++](http://stackoverflow.com/q/12207634) – Bernhard Barker Mar 24 '14 at 09:09
-
1-1 "This question does not show any research effort." – Ali Mar 24 '14 at 11:19
1 Answers
1
From cppreference:
Maps are typically implemented as binary search trees.
By default less<T> is used to compare keys, but you can specify your custom compare function for that as template parameter.
Vladimir
- 169,112
- 36
- 383
- 312