Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C++ code for below question Using division method and multiplication met

ID: 3532564 • Letter: W

Question

Write a C++ code for below question

Using division method and multiplication method for a hash function H and a hash table of size m ,store data of student ID's (n=150) to an array of linked list for collision resolution

DIvision method-

H(k)=k mod m , m:is a prime number around 150/3 and 2**5<m<2**6 and not too close to the power of 2.

Multiplication method-

H(k)=[m*(k*A mod 1)], A=(5**(1/2)-1)/2=0.6180339887 (By Knuth 1973), m:a natural number for table size eg 59

Using Quadratic probing to do hashing with hash table size m (eg 67),enter 60 student ID's without using array of linked list.

For all 3 methods,implement the following

1.Enter 6 digit student ID's using random number generator and map into hash table using chaining for division and multiplication method,hashing algorithm for quadratic probing method.

2.Print out hash table with values for each cell.

3.Perform two searches-one with ID found and the other one with ID not found.


Please provide full C++ code.


Explanation / Answer

Two step process

h(k) =

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote