In C++ please. Thank You

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

In C++ please. Thank You

Post by answerhappygod »

In C++ please. Thank You
In C Please Thank You 1
In C Please Thank You 1 (103.9 KiB) Viewed 29 times
2. (45 pts) A simple hash table can be implemented, for integers, as an array (not vector) of linked lists. For a simple hash function, we can use the modulo to find the "hash" value of an integer. Specifically, if we have a 10 element array, and want to store the value 103, we would store it in position 3 (103%10-3). If we had a 15 element array, that same value would hash to 13 (103 %15-13). Since multiple values can "hash" to the same location (collision), we use the linked list to resolve collisions (separate chain hashing). A good start is to have an array size of 5, but to double the size of the array (and rehash all of the values, of course) when the array gets more than 80% full (so the first resize will happen after 5 inserts). Please implement the following: The IntHasher class which contains, at least, the following Insert (add an int to the table) Remove (take an int out of the table; do nothing if it doesn't exist) Find (return true or false if it exists) O O O An output operator which prints ALL of the values in the hash table (order doesn't matter), one per line ● An addition operator which allows for the combination of two intHasher objects.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply