Answered step by step
Verified Expert Solution
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 functions:
divhashint key, int : divides key with size of hash table and use remainder of it returns hash value
kmodM
mod
midsqrhashint key, int M: it has steps:
Square the key which is
Take digits from square of key by dividing it by and further mode by return hash value
The hash value obtained is
doublehash int key, int M:
key
example : key
rehash is not palindrome
rehash is palindrome stop
if i and rehash value is not palindrome then make reverse of rehash as hash value.
return hash value
multhashint key, int A:
Perform following steps:
Choose a value A from AMCt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started