0

I just wanted to how unordered map stored the data into the bucket and what hashing function it is implementing.Also the internal implementation of Hashing function i wanted to know in C++.How data is stored on what basis? Thanks in Advance :)

cpplearner
  • 13,776
  • 2
  • 47
  • 72

1 Answers1

2

Different implementations of the standard library can use different hashing algorithms, storage details etc. Since the code invovles templates, most (if not all) standard library implementations contain the relevant code in headers. So you can just open the <unordered_map> header shipped in your standard library and start looking.

Angew is no longer proud of SO
  • 167,307
  • 17
  • 350
  • 455
  • But if i see like the internal implementation of this can't able to understand it .So if i write a simple program for the same and get it the bucket stored data internally how it is doing then only i can get to know. nordered_map mymap = { {"Shashi","Singh"}, {"Sumit","Arora"}, {"Kunal","Yadav"}, {"Bhargavi","Boddapati"}, {"Biplab","Kundu"}, {"Satyaraj","Natarajan"} }; ....now please tell me how it is sored in bucket Please :) – shashi singh Aug 23 '17 at 10:01
  • @shashisingh You **don't** use the internal implementation. You use the public members. **Especially** if you don't understand the contents of `` – Caleth Aug 24 '17 at 22:52
  • 1
    @shashisingh I'm confused. Either you're after the implementation details (as your question seems to indicate), in which case study the implementation (and you will of course need sufficient C++ and data structure understanding). Or you want to know how to *use* an unordered map, in which case consulting suitable [reference](http://en.cppreference.com/w/cpp/container/unordered_map) should work for you. – Angew is no longer proud of SO Aug 25 '17 at 06:16