Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write a program in C. 1. Implement a dictionary using a hash table with these specifications For collision resolution it uses either quadratic hashing
Please write a program in C.
1. Implement a dictionary using a hash table with these specifications For collision resolution it uses either quadratic hashing or double hashing. The table size should between 2 times and 4 times the number of lines in the dictionary file o o o It cannot be more than 4 times the number of lines in the file It can be hardcoded to a number that works well for the data in the Spanish.txt file Hint: You may want to use a prime number for the size of your hash table It must use a good function for hashing strings. You may use any resource for this function but you must cite it. You are allowed to use code you find on the web for this function alone, but you must cite it. - 2. After the table is created display the statistics for building it. (Details will be provided below.) 3. Allow the user to use and update the dictionary through these operations: search, insert, delete, quit. Each operation (with all its needed data) will be given on one line as follows Line Explanation and behavior g- Quit Ends the loop that allows the user s Search Will search the dictionary for word It will display the number of probes the search took. If found, will display the translation. If not found will display a messa d- Delete Will search the dictionary for word. If found it will remove it. If not found it will display a message. i - Insert It will search the dictionary for word If found, it wll update the existing translation by appending; and newTransl If not found it will add this new entry to the dictionary ations s word d word i word newTransl You can assume that new Transl is a single word of at most 100 characters. For example el gato cannot be given as a new translation for insertion in this loop because it consists of two words. You can assume that for all operations above, word is at most 100 characters, and the operation (s/d/iq) will have at most 2 characters 4. Report the statistics for the user operations. (E.g. if the user performed 10 dictionary operations (insert, delete, or search), report the average number of probes per operation 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