Nowadays I am looking python source code, and I found both python and C# use hash to implement Dictionary.
The time complexity of hash is O(1) and RBtree is O(lgn), so can anybody tell me the reason why the C++ STL uses RBtree to implement std::map?
Because it has a separate container for hash tables:
std::unordered_map<>. Note also that .NET hasSortedDictionary<>in addition toDictionary<>.