Lab 10 Hash table with open addressing Solution

$30.00

Description

In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double hashing. Create an empty hash table of size m = 13. Each integer of the input will be a key that you should insert into the hash table. Use the double hashing function h(k; i) = (h1(k) + ih2(k)) mod 13 where h1(k) = k mod 13 and h2(k) = 1 + (k mod 11). The input terminates when the key 1 is read (such a key must not be inserted in the hash table). At that point, print the content of the hash table to the screen (see sample input/output below for the printing format). Then, read integers from the input until the number 2 is found (do not process that number). For each number inputted, print the index of the element in the hash table. If the number is not inside the hash table, print NOT FOUND. Finally, read integers from the input until the number 3 is found (do not process that number). For each number inputted, delete it from the hash table (note that the integer might not be in the table). Once the integer 3 is found, print the hash table.


error: Content is protected !!