Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following sequence of keys is to be inserted into an initially empty hash table of size 8 that employs open addressing: cat, goat, dog,

The following sequence of keys is to be inserted into an initially empty hash table of size 8 that employs open addressing:

cat, goat, dog, bird, bison, ant, flea, bat, duck 

The hash function assigns to each key the number of characters in the key. For example,h("cat")is 3, because"cat"has 3 characters.

  1. Assume thatlinear probingis used to insert the keys. Determine which key causes overflow, and show the table at that point by copying the following template into your text file and adding the keys at the appropriate positions:
0:  1:  2:  3:  4:  5:  6:  7: 
  1. Now assume thatquadratic probingis used. Determine which key causes overflow, and show the table at that point.
  2. Finally, assume thatdouble hashingis used, with the value of the second hash function based on the first character in the key: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, etc. Determine which key causes the table to overflow, and show the table at the point at which it does so.
                        

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_2

Step: 3

blur-text-image_3

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

=+a. What is the name of your country's currency?

Answered: 1 week ago