Is there a structure in Python similar to C++ STL map?

前端 未结 6 1151
没有蜡笔的小新
没有蜡笔的小新 2021-02-05 05:02

Is there a structure in Python which supports similar operations to C++ STL map and complexity of operations correspond to C++ STL map?

6条回答
  •  遥遥无期
    2021-02-05 05:52

    I believe that the standard python type dict() will do the trick in most cases. The difference from C++'s std::map is that dict is impemented as a hash map and C++'s map is tree-based.

提交回复
热议问题