+1(978)310-4246 credencewriters@gmail.com
  

Programming Problem Suppose you are implementing a dynamic set
of bank account records as a hash table for the Sun
Devil Bank. Each bank record has an account number, owner’s name, and the
current balance. the
account number is any six-digit integer number between 100001 and 999999.
No two records can
have the same account number. In addition to the key, each record has the
following information.
Even though the account number can take a value between 100001 and
999999. Even though the
account number gives a higher range of numbers bank will not have more
than 800 accounts at a
given time.
Hash Table Implementation Details: You will implement this hash table in two
ways as described
below. You need to design a suitable node structure for the account record
and then each slot in
the hash table can be a pointer to an account record
a) [40 Points] Hashing chaining in case of collision. Hash function h(k) = k
mod m
Assume that the hash key is k mod m and using chaining in case of a
collision. The size (m) of
the hash table (T) is 753. Also, you can assume that account numbers are
generated using a random
uniform distribution function and each account number is unique.
Write a C or C++ program that Implements the hash table construction for the
above scenario and
then implement the following three functions
a) INSERT_Account(T, x) // insert the bank account record x to the table
b) DELETE_Account(T, k) // delete the bank account record from the table
where
k is the account number
c) SEARCH_Account(T, k) //search the account number k in the hash table
and
returns the corresponding bank account record, and display account
information
For the insert operation, read the owner’s name, account number, and the
account balance from
the keyboard. For delete and search operations, read the account number
from the keyboard
Save your program as hash_chain.cpp or
hash_chain.c
b)[ 30 Points] Hashing open addressing in case of collision. Use linear probing
h(k, i) = (h’(k) + i) mod m. i = 0, 1, 2, …, and h’(k) = k mod m
The size (m) of the hash table (T) is 753. Also, you can assume that account
numbers are generated
using a random uniform distribution function and each account number is
unique.
Write a C or C++ program that Implements the hash table construction for the
above scenario and
then implement the following three functions
INSERT_Account(T, x) // inserts the bank account record x to the table
SEARCH_Account(T, k) //searchs the account number k in the hash table and
returns the corresponding bank account record and displays account
information.
For the insert operation, read the owner’s name, account number, and
account balance from the
keyboard. For the search operations, read the account number from the
keyboard
Save your program as hash_open.cpp or
hash_open.c

Purchase answer to see full
attachment

  
error: Content is protected !!