However, in C++ STL, map is a sorted associative array, and is implemented by red-black tree. Therefore, more precisely, in C++, a map is a container that implemented by red-black tree, and nodes are
In java, a map is an interface that “maps keys to values.” The abstractmap class implemented map interface. Under the “abstractmap” class, there are hashmap and treemap. Obviously, a hashmap is implemented by hash table, and a treemap is implemented by red-black tree.
Therefore, when we talk about “map”, we have to know the context. However, saying “a hash table” is a map is always not right.
No comments:
Post a Comment