Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer the following questions on hash tables [16pts total] a. Using the following prehash method: [6pts] prehash(S)=length(S)/i.e.thenumberofletters Take the value returned by the prehash method
Answer the following questions on hash tables [16pts total] a. Using the following prehash method: [6pts] prehash(S)=length(S)/i.e.thenumberofletters Take the value returned by the prehash method and run it through the division hash method to get the bucket index. Then insert the item into the hash table below. Use chaining for collision resolution. Make sure to show the null values. Here are the items you are to insert: - IT - Food - FizzyBuzzy - The - Cook - Luck b. What is the load factor (aka ) of the hash table above? State the formula used to calculate the load factor first, then plug in the right numbers and show the resulting load factor. [1pt] d. Take the finished hash table from part (a) and enlarge it to a size of 8 buckets (shown belowi). Uhe the same prehash function, however this time use linear probing for collisions. You the resulting larger hash table. the division method as your hash function. Show the resulting larger hash table. Hint: Read the entries in the old table from left to right and top to bottom. [6pts] e. What is the new load factor of our table? [1pt] f. Should we resize our table again? What is the rule for knowing when to resize? If we should resi what would be the ideal new size for our hash table? [1pt]
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