What data structure is inside std::map in C++?

前端 未结 6 909
余生分开走
余生分开走 2020-12-03 11:34

I\'m beginner and learning C++ Having hard times to understand std::map concepts, because the code I\'m playing with implies that the map is a search tree, i.e.

6条回答
  •  -上瘾入骨i
    2020-12-03 11:59

    I would say that if you think of a map as a pair you can't go wrong. Map can be implemented as a tree or a hash map, but the way it is implemented is not as important since you can be sure any implementation is STL is an efficient one.

提交回复
热议问题