I did, which is what was throwing me off. I took the modulus of each hash code and found the index for each. I then created a separate chaining diagram, with the Chargers at index 2, Saints at 4, Texans at 5 with a chain to 49ers, Steelers at 7, and Patriots to Packers to Giants at 10. Is that right, or am I way off?
Lol. I'm trying to map the teams to their appropriate cells in an array. There are 8 teams with their respective hash codes. That was all I was given. One array uses separate chaining and the other uses quadratic probing to avoid collisions. I had no idea how to determine the index for each team until I decided to divide each hash code value by the arraySize (which is 13) in this case. The modulus os the array index, i believe. The threshold is .75, but I dont think either array will have to be resized with only 8 items. Is that the right way to do it?
To show the locations of each team in a hash map array using a load factor of .75. The first problem uses separate chaining to avoid collisions. The second used quadratic probing to
avoid collisions. I created two diagrams showing the arrays and their respective locations, and I calculated the indexes based on modular division, wherein I divided the hashcode values by the array size, which was initialized at 13 in the assignment. Just wanted to know if that was the proper way to determine the index locations.
This post has been edited by iburres: 26 April 2013 - 06:36 AM