+ 1

C++ Hash Maps?

How exactly do I use a hash map? Google just gives me articles defining what a hash map is, but I can't seem to find an example of any kind. Can somebody write a hash map c++ code for me?

31st Jan 2019, 3:21 PM
Daniel Cooper
Daniel Cooper - avatar
4 Antworten
+ 3
Well, we have std::map and std::unordered_map in STL. If you're not looking to implement it yourself, you can start experimenting with these two classes, to get an understanding of how elements are accessed when stored as a key-value pair. https://en.cppreference.com/w/cpp/container/map/map I just worked with std::map recently: https://code.sololearn.com/c1lMn34wFq8v/?ref=app
31st Jan 2019, 3:35 PM
Hatsy Rei
Hatsy Rei - avatar