Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code has following 4 functions: div _ hash ( int key, int M ) : divides key k with M size of hash table

The code has following 4 functions:
div_hash(int key, int M): divides key k with M size of hash table and use remainder of it, returns hash value
h(K)=kmodM
k=12345
M=95
h(12345)=12345mod95
,=90
mid_sqr_hash(int key, int M): it has 2 steps:
Square the key k, which is k**k.
Take digits from square of key by dividing it by M and further mode by M, return hash value
h(K)=h(kxk)
k=60
M=100
kxk=6060
=3600
h(60)=60??100%100
The hash value obtained is 60
double_hash (int key, int M):
h1(key)=key%M
h2(key)=1+( key %13)
example : key =12345
M=1000
h1(12345)=345
h2(12345)=1+(12345%13)=1+8=9
i=1 rehash =345+1**9=354,354 is not palindrome
i=2 rehash =345+18=363 is palindrome stop
if i>5 and rehash value is not palindrome then make reverse of rehash as hash value.
return hash value
mult_hash(int key, int A):
Perform following steps:
Choose a value A from AMCt+
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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

5.2 Summarize the environment of recruitment.

Answered: 1 week ago