8. Let's look at the actions of HashSet. Assume the following: • the hash table array has an initial capacity of 10 • the hash table uses chaining for resolving collisions • the hash function returns...



Please don't use answer already posted on other websites.


will leave you feedback!!


Thank you!


8. Let's look at the actions of HashSet.<br>Assume the following:<br>• the hash table array has an initial capacity of 10<br>• the hash table uses chaining for resolving collisions<br>• the hash function returns the integer key's value, mod the size of the table, i.e., h(1) = i % 10<br>• rehashing occurs at the end of an add where the load factor is 2 0.5 and doubles the capacity of<br>the hash table<br>Draw an array diagram to show the final state of the hash table after the following operations<br>are performed.<br>Leave a box empty if an array element is null or is unused.<br>You do not have to redraw an entirely new hash table after each element is added or removed,<br>but since the final answer depends on every add/remove being done correctly, you may wish to<br>redraw the table at various important stages.<br>YOU MUST SHOW ALL WORK FOR FULL CREDIT.<br>Set<Integer> set - new HashSet( );<br>set.add(47);<br>set.add(97);<br>set.add(52);<br>set.add(-34);<br>set.remove(4);<br>set.remove(52);<br>set.add(44);<br>set.add(77);<br>set.add(-232);<br>set.add(-4);<br>set.add(444);<br>Size =<br>Capacity =<br>Load factor =<br>

Extracted text: 8. Let's look at the actions of HashSet. Assume the following: • the hash table array has an initial capacity of 10 • the hash table uses chaining for resolving collisions • the hash function returns the integer key's value, mod the size of the table, i.e., h(1) = i % 10 • rehashing occurs at the end of an add where the load factor is 2 0.5 and doubles the capacity of the hash table Draw an array diagram to show the final state of the hash table after the following operations are performed. Leave a box empty if an array element is null or is unused. You do not have to redraw an entirely new hash table after each element is added or removed, but since the final answer depends on every add/remove being done correctly, you may wish to redraw the table at various important stages. YOU MUST SHOW ALL WORK FOR FULL CREDIT. Set set - new HashSet( ); set.add(47); set.add(97); set.add(52); set.add(-34); set.remove(4); set.remove(52); set.add(44); set.add(77); set.add(-232); set.add(-4); set.add(444); Size = Capacity = Load factor =

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here