Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following U.S. state abbreviations as your keys to a hash table: AZ, AL, HI, NJ, OK, LA, NC, WA, RI, MA, WY, OR,

image text in transcribed

Consider the following U.S. state abbreviations as your keys to a hash table: AZ, AL, HI, NJ, OK, LA, NC, WA, RI, MA, WY, OR, KS (The entries accessed by these keys need not concern us; perhaps they are large records containing information about the corresponding state.) Use the following hash function: H(s)=s13+s2 where s1 and s2 are the positions of the first and second letters of the key s in the alphabet. (So, when s=AZ,s1=1 and s2=26 ) 1. [5 points] (a) What is the range of the hash function H ? 2. [5 points] (b) If the size of your hash table less than the size of the range, how do you convert the hash function into an index into the hash table? 3. [5 points] (c) Construct a hash table of size 23 using open hashing as your mechanism for handling collisions. Show all the steps, i.e., draw the hash table every time you add a new key. (Note, it might be easiest to write a program in a high level language like Python to do this) 4. [5 points] (d) What is the load factor of this hash table? 5. [5 points] (e) How many words of memory does it occupy (in addition to the space occupied by the entries). Assume that pointers occupy one word, and that your hash table stores pointers to the entries

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago