C++ Associative Containers: Properties, Internals, and Relevant Algorithms

1 · Jiyang Tang · Sept. 2, 2022, 5:31 p.m.
This is my detailed notes about C++’s containers: std::set std::map std::multiset std::multimap std::unordered_set std::unordered_map NOTE: I assume that at least C++11 or a newer standard is used SET/MAP/MULTISET/MULTIMAP set map multiset multimap Properties sorted set/map has unique keys, multiset/multimap allows duplicated keys the insertion order of duplicated keys is preserved internally implemented as red-black trees (in most STL libraries) Space Complexity $ O(n) $ Time complexity...