Hash map is an associative container that allows you to quickly retrieve individual elements based on key values.
Elements inside the unordered_map are not sorted in any particular order by key or mapped elements, and their storage location depends on the hash value allowing for quick access to a single element (with a constant average time complexity) directly through its key value.
Hash map allows you to use the operator operator (operator []) to directly access an element with its key value as a parameter.
Map determines whether elements are the same according to operator<, compares the size of elements, and then chooses the appropriate location to insert into the tree. So, if the map is traversed (in the middle order traversal), the result of the output is ordered. The order is sorted by the size defined by the operator<.
In any case, if you want to choose between these two containers, we should not hesitate to choose Unordered_map. Because of his performance in the above 4 operations are superior to hash_map, and even can be said to be far superior to hash_map.
When we need an orderly associative container, we have to choose Std::map.
C + + unordered_map map