Confusion on hash table efficiency?

I am confused on the efficiency of hash tables. Say my hash table has a size of 200 and I store 150 objects inside. Using linear probing to deal with collisions, I'll be rehashing a lot to find an empty space. Now after increasing the size of the hash table to reduce collision, wouldn't it be harder to search for an element since the hash function will no longer hash to the same value thus elminating the point for using hash tables (my hash function uses tablesize so hash value will be different)?

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.