Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write the code using C language (not Java nor C++) .You can use Modulo-division Hashing for the hash algorithm of this question (or some

Please write the code using C language (not Java nor C++) .You can use Modulo-division Hashing for the hash algorithm of this question (or some other hashing algorithm if you like, but please mention the type of algorithm used). The size of the hash table is 4. Please create a hash table according to the data of table13-4. If a txt file is used, please remember to attach it.

The following is the work to be done when the program is executed.

When the program is executed, first print out the entire contents of the hash table, then print out the efficiency of the hash algorithm, and finally ask the user to input the data to be searched, and then print the results of the search (for the format, please refer to the example given in the title) .

image text in transcribed

image text in transcribed

19. Write a program that uses a hashing algorithm o create a list of inventory parts and their quantities sold in the past month. After creating the hashed list, write a simple menu-driven user interface that allows the user to select from the following options: a. Search for an inventory item and report its quantity sold b. Print the inventory par c. Analyze the efficiency of the hashing algorithm ts and their quantities sold The parts data are contained in a text file, as shown in Table 13-4. The key is the three-digit part number. The quantity represents the units sold during the past month Quantity 12 30 56 17 Part number 112 130 156 173 197 150 166 113 123 143 167 189 193 50 14 176 76 Three outputs are required from your program a. Test the following searches and return appropriate messages. You may test other part numbers if you desire, but the following tests must be completed first . Search for 112 Search for 126 . Search for 173 b. When requested, analyze the efficiency of the hashing algorithm for this set of data. Your printout should follow the report format shown below. Percentage of Prime Area Filled: xx% Average nodes in linked lists nn Longest linked list c. The printout of the entire contents of the list should use the follow- ing format Home Addr Prime Area Overflow List 130/30 112/12 123/12 143/14, 173/17, 193/19

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

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago