- Mastering C++ Programming
- Jeganathan Swaminathan
- 94字
- 2021-07-02 18:28:53
Unordered maps
An unordered map works in a manner similar to a map, except that the internal behavior of these containers differs. A map makes use of red-black trees while unordered map makes use of hash tables. The time complexity of map operations is O( log N) while that of unordered map operations is O(1); hence, an unordered map tends to be faster than a map.
The values stored in an unordered map are not organized in any particular fashion, unlike in a map where values are sorted by keys.