Hash Datatable FAMILY NAME GIVEN NAME Gonzalez Sofia Murphy Jack Ivanova Alexander Sato Sakura Garcia Angela Rossi Auror
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Hash Datatable FAMILY NAME GIVEN NAME Gonzalez Sofia Murphy Jack Ivanova Alexander Sato Sakura Garcia Angela Rossi Auror
Hash Datatable FAMILY NAME GIVEN NAME Gonzalez Sofia Murphy Jack Ivanova Alexander Sato Sakura Garcia Angela Rossi Auroral Kazlauskas Gabija Sari Muhammad Jovanovic Dragan Khan Fahd Ibrahim Sade Yilmaz Emine Rodriguez Carlos Tan Nor Popa Elenal John Samson Tesfaye Negasi Joseph Juan Lopez Andrew Devi Aadya Kim Seo-yun De Jong Anna Juma Emmanuel 1. Choose an array size. To reduce collisions, an array size that is prime is recommended. The calculation you use will need to result only in integer values between zero and one less than your array size. An easy way to do that is to calculate a much larger value and take the modulus by your array size like the in the example. An array should be large enough so there is space to spread data without collisions. 2. Develop a hash function calculation that you can apply to every name in the data set. The goal is for the hash to have an equal chance of equaling any of the values allowed. You must use a different hash function than the example here. 3. Describe how you will handle any collisions that occur. Moving to the next cell is just one option, other possibilities are n number of cells away or a more complex function. Just moving one cell away as in the example can result in bunching around a collision point. Moving multiple cells to spread apart is desirable. 4. Apply your hash and collision rule to the full set of name data and generate the final array. You may implement the hash function and collision rule in a program if desired but are not required to do so. If you do implement as a program, the code should be integrated as text in your submission document.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!