GU Implementing Hashing Algorithm and Python Worksheet

User Generated

pffghq

Computer Science

Georgetown University

Description

Write a Python program and provide the outputs.

Part A): Creating Hash table

  • Given a hash table of size 35, create a hash table with 32 AU/CS students’ IDs (5 digits ID), using division hash function with largest prime# <= hash table size and Linear probing for Overflow/Collision handling. After creating the hash table, print the average number of probing in creating the hash table.
  • Search for a Key in the hash table (try 4 different keys). Print appropriate messages (key found, or key does not exist in the hash table). Also, after the searches, print the average number of probing.

Part B):

Repeat Part A with Hash table size of 50. (Use the same 32 students as in Part A) & (Use the same 4 keys for searching as in section 2 of Part A).Does the increase in hash table size decrease the number of probing? Explain your findings.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

View attached explanation and answer. Let me know if you have any questions.Well, it is the final program (with comments). Feel free to ask for explanations and/or cor...


Anonymous
I was stuck on this subject and a friend recommended Studypool. I'm so glad I checked it out!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags