Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider search keys that are distinct integers. If the hash function is h(key) = key modulo 5 and separate chaining resolves collisions, where in the

Consider search keys that are distinct integers.  If the hash function is h(key) = key modulo 5 and separate chaining resolves collisions, where in the hash table do the following search keys appear after being added?

list a= 4, 6, 20, 14, 31, 29 

indexbucket
[0] 
[1] 
[2] 
[3] 
[4] 

hushTable

                                                                          

2.    Using the same problem #8, use the hash function h(key) = key modulo 11 with a hashTable size eleven and 

a)  Linear probing to resolve collisions. 

           
012345678910

 

b) Quadratic probing. 

           
012345678910

 

c) Double hashing.     h2(key)  =  7 - ( key mod 7)

           
012345678910

 

 

(Continued next page.)

3.    Using a list with more collisions, the same hash function, and the respective collision resolutions, show the resulting hashTables.

               h(key) =  key mod 11                     list =  4, 6, 15, 26, 8, 5

 

a) Linear probing to resolve collisions. 

           
012345678910

 

b) Quadratic probing. 

           
012345678910

 

c) Double hashing.     h2(key)  =  7 - ( key mod 7)

           
012345678910

 

indexbucket
[0] 
[1] 
[2] 
[3] 
[4] 


d)  Separate chaining.  h(key) = key mod 5   

Step by Step Solution

3.46 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

Consider search keys that are distinct integers If the hash function is hkey key modulo 5 and separa... 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

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Programming questions

Question

Who receives responsibility reports? What do the reports include?

Answered: 1 week ago