2 ms·
>Almost every other language's library tends to implement sets as a special case of a hash map without values, just keys. C++ is even weirder. It implements st
by matthewaveryusa 10y ago
>Almost every other language's library tends to implement sets as a special case of a hash map without values, just keys.
C++ is even weirder. It implements std::map as a std::set that has std::pair, keyed on the first element in the tuple. both std::set and std::map use a tree structure (RBtree) C++11 has unordered set/map which uses hashing.