8. Let's look at the actions of HashSet. Assume the following: the hash table array has an initial capacity of 10 • the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

8. Let's look at the actions of HashSet. Assume the following: the hash table array has an initial capacity of 10 • the

Post by answerhappygod »

8 Let S Look At The Actions Of Hashset Assume The Following The Hash Table Array Has An Initial Capacity Of 10 The 1
8 Let S Look At The Actions Of Hashset Assume The Following The Hash Table Array Has An Initial Capacity Of 10 The 1 (87.66 KiB) Viewed 57 times
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(i)=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<Integer> 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 =
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply