Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the following 4 exercises in python Given input { 4 3 7 1 , 1 3 2 3 , 6 1 7 3 ,

Complete the following 4 exercises in python
Given input {4371,1323,6173,4199,4344,9679,1989} and a hash function h(x)=x
mod 10, show the resulting Hash Table. Note: the hash table will start at 0 and end at 9
for a size of 10.
a. Separate chaining hash table
b. Hash table using linear probing
c. Hash table using quadratic probing where c_11,1, c_2=2
d. Hash table with second hash function h2(x)=7-(xmod7)
Write a program to compute the number of collisions required in a long random
sequence of insertions using linear probing, quadratic probing (c_1=1, c_2=2) and
double hashing. For simplicity, only integers will be hashed. The same random sequence
must be used for all insertions. The simulation should continue until the first 500
numbers from the random sequence (integers in the range of 1 to 100,000) have been
inserted. The hash table should be a fixed size of 10,001.(Note: Don't forget to mod by
the table size also)
Hash function h(x)=x%300
Second hash function: h2(x)=9973-(x%9973)
Why are the number of collisions so high for linear probing? How would it be possible to
reduce the number of collisions for linear probing (without increasing the hash table
size)?
Implement your solution for number 3. Discuss/analyze your solution and if you were
able to reduce the number of collisions.
image text in transcribed

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

Is there a clear hierarchy of points in my outline?

Answered: 1 week ago